Versions Compared

Key

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

Step summary

  1. Enter Debug mode.

  2. Use R89SDK.singleTagConfiguration 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

Code Block
languagedart
R89SDK.setDebug();

We also recommend adding

Code Block
languagedart
R89SDK.setLogLevel(LogLevel.debug);

Full example

Code Block
languagedart
R89SDK.setLogLevel(LogLevel.debug); 
R89SDK.setDebug(getLocalFakeData: true); 

/* <SingleTagConfiguratorCode> */
addTestingSingleTagData()

R89SDK.initialize(
      publisherId: "TestRefinery89ID", /* This is for testing purposes, change it on prod */
      appId: "TestDemoApp", /* This is for testing purposes, change it on prod */
      singleTag: true);

use R89SDK.singleTagConfiguration to add your single-tag data

Code Block
languagedart
void addTestingSingleTagData() {
    // Define the initial/home route name as the main screen, 
    // in the example it is MainPage
    R89SDK.singleTagConfiguration.initialRouteName = '/'
    // Configure the main screen with ad placements
    R89SDK.singleTagConfiguration.addAdScreenConfig(
        adScreenConfig: AdScreenConfig(screenName: '/')
          // Add a banner inside the wrapper with the tag 'main_page_bottom_ad_container'
          ..addBanner(
                tag: 'main_page_bottom_ad_container',
                getAllWithTag: false, // Only place ad in the first R89Tag wrapper in the screen, 
                                      // in case there are multiple R89Tags with the same tag: available on the same screen.
                wrapperRelativePositionAfter: true, // Place the ad below the child of R89Tag(child:...)
          )
          // Triggers an interstitial when transitioning from "MainPage" ("/") to "NewsPostDetailPage"
          ..addInterstitial(eventToTrack: 'NewsPostDetailPage')
          // Triggers an interstitial when a child of R89Tag(tag:'play_video_trailer_tag',child:...) is pressed
          ..addInterstitial(eventToTrackButton: 'play_video_trailer_tag')
    );
}