Mediafy SDK - Integration

Mediafy SDK is available for integration via CocoaPods dependency manager and direct download of the compiled framework.

Cocoapods

Note: If the CocoaPods dependency manager has already been integrated into the project, follow the “Get Started” instructions on cocoapods.org.

To add the Mediafy SDK into your app you should include this line into your Podfile within the application target:

pod 'MediafySDK'

Then run pod install --repo-update in the project folder.

Direct download

The Meidafy SDK is also available via a direct download link:

https://sdk-cdn.mediafy.io/ios/mediafy-sdk/2.4.6/MediafySDK.xcframework.zip

SDK Initialization

First, you need to import the core Mediafy SDK class into the main application class:

import MediafySDK

Then you need to initialize the Mediafy SDK in the application:didFinishLaunchingWithOptions method by calling Meidafy.initializeSDK() method.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {   
    
    // Initialize Mediafy SDK.
    Mediafy.initializeSDK(accountSettings: SETTINGS)
    Mediafy.setSubdomain(subdomain: ACCOUNT_SUBDOMAIN)
}

Parameters:

  • accountSettings - provided account parameters string (f.e. "bid=text")
  • subdomain - determine the subdomain of Mediafy exchange URL for a particular partner.

The Mediafy account manager should provide you with both of these keys.

At the application initialization stage, you should also provide additional contextual information that SDK will use in the ad requests. The full list of supported contextual signals is available in the documentation for SDK Global Parameters class.

As soon as SDK is initialized and contextual information is provided, it is ready to request the ads.

Contact us today to enjoy endless opportunities!

Contact Us
+

Thanks for your interest,
please leave your details and we'll get things rolling!