Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Step

...

summary

  1. Enter Debug mode

  2. Use SingleTagConfigurator to append custom data that would otherwise not exist either in the fake local data or in our prod API.

  3. Initialize normally the single tag implementation

1. Enter

...

debug mode

For testing single tag implementation add this before initialization

...

use SingleTagConfigBuilder to add your own single-tag data.

Code Block
languageswift
import UIKit
import R89SDK

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    ...
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        ...
        addTestingSingleTagData()  /* This is a later step */
        R89SDK.shared.initialize(...)
        return true
    }
    
    func addTestingSingleTagData(){
        // Add a Screen that is a UIViewController, the screenName you can get it by logging this in you code ->
        // in viewDidLoad you can use self.name ->
        // on InitialScreenViewController -> InitialScreenViewController
        // on NewsPostDetailScreenViewController -> NewsPostDetailScreenViewController
        
        let screenBuilder = SingleTagConfigBuilder.shared
            .addAdScreenBuilder(isFragment:false,screenName: "InitialScreenViewController")
        
        // Add a banner format to the wrapper with the tag main_activity_bottom_ad_container
        screenBuilder.addBanner(wrapperTag: "banner_tag",
                                getAllWithTag: true,
                                wrapperRelativePositionInside: true,
                                wrapperRelativePositionAfter: false)
        
        /* trigger interstitial when we transition from "InitialScreenViewController" (ScreenBuilder.screenName) TO NewsPostDetailScreenViewController */
        screenBuilder.addInterstitial(eventsToTrackTo: "NewsPostDetailScreenViewController",
                                      eventsToTrackButton: nil)
        
        /* trigger an interstitial when a button with this tag is pressed in "InitialScreenViewControllerj" (ScreenBuilder.screenName) */
        screenBuilder.addInterstitial(eventsToTrackTo: nil,
                                      eventsToTrackButton: "buttonplay_video_trailer_tag")
    }
    ...
}