Mars SDK - Integration

Mars 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 Mars SDK into your app you should include this line into your Podfile within the application target:

pod 'MeidafySDK', '2.4.5'

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.5/MediafySDK.xcframework.zip

SDK Initialization

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

import MediafySDK

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

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {   
    
    // Initialize Mars 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 Mars exchange URL for a particular partner.

The Mars 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
+

Contact Us