Mars SDK is available for integration via CocoaPods dependency manager and direct download of the compiled framework.
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.
--repo-update
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
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.
application:didFinishLaunchingWithOptions
Meidafy.initializeSDK()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Initialize Mars SDK. Mediafy.initializeSDK(accountSettings: SETTINGS) Mediafy.setSubdomain(subdomain: ACCOUNT_SUBDOMAIN) }
Parameters:
accountSettings
subdomain
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.