Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

Prerequisites

Do iOS Get Started until finishing step 3.

Step summary

  1. Add the initialization code.

  2. Add the ad wrapper views in your app.

  3. Follow our ad format guides for their implementation.

  4. Test everything is working.

  5. Change everything to production code.

  6. Your app is now prepared for monetization with us.

Initialize the SDK

Note

We require the SDK to be initialized only once as early as possible so for this purpose using the UIApplicationDelegate’s didFinishLaunchingWithOptions method or the first UIViewController’s viewDidLoad method is recomended.

Override the didFinishLaunchingWithOptions delegate method inside the UIApplicationDelegate class.

Code Block
languageswift
import UIKit
import R89SDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        R89SDK.shared.setLogLevel(level: LogLevels.debug) // This is for testing purposes, remove it on prod
        R89SDK.shared.setDebug() // This is for testing purposes, remove it on prod
        R89SDK.shared.initialize(
          publisherId: "TestRefinery89ID", // This is for testing purposes, remove it on prod
          appId: "TestDemoApp", // This is for testing purposes, remove it on prod
          singleLine: false,
          publisherInitializationEvents: nil
        )
        
        return true
    }
}
Info

Your publisherId and appId will be provided to you during onboarding process by email, you can also retrieve them from the web interface after login.