Testing Integration

After you have integrated now.gg Rewarded Ads with your app; you can use the steps listed here to test integration for your apps on Unity and Native Android.

Process

Enable Debug Mode

Before you start testing, you must enable the debug mode in your app.

We have provided a detailed illustration to enable debug mode for your apps on:

1. Native Android

To enable debug mode for your Android app, add NowGGAds.enableDebugMode(); to the onCreate method of your app’s main activity, as illustrated below:

   
@Override
 protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     showAdButton = findViewById(R.id.showAd);

     /* IMPORTANT: Use this line to test integration on Bluestacks 5/now.gg Testing Environment and remove it from prod/release build */
     NowGGAds.enableDebugMode();
    
     NowGGAds.initialize(this, initializationStatus -> {
         Log.d(TAG, "onInitializationComplete: " + initializationStatus);

         if (initializationStatus.getState().equals(State.NOT_READY)) {
             Log.d(TAG, "onInitializationComplete: error");
             // retry creating NowGGAds
         }
     });

Important Information

  • The enableDebugMode() function should only be initialized for the testing environment.
  • You must remove this function before submitting the release version of your App build to now.gg Cloud.

2. Unity

To enable debug mode for your app on Unity, call the EnableDebugMode() function of the NowGGAdsManager class before initializing the module, as illustrated below:

void Start()
   {
       NowGGAdsManager.Instance.OnInitSuccess += OnInitSuccess;
       NowGGAdsManager.Instance.OnInitFailed += OnInitFailed;
       NowGGAdsManager.Instance.OnNowGGRewardedAdDismissed += OnAdDismissed;
       NowGGAdsManager.Instance.OnNowGGRewardedAdFailedToLoad += OnAdFailedToLoad;
       NowGGAdsManager.Instance.OnNowGGRewardedAdShownToUser += OnAdShownToUser;
       NowGGAdsManager.Instance.OnUserEarnedReward += OnUserEarnedReward;

/* IMPORTANT: Use this line to test integration on Bluestacks 5/now.gg Testing Environment and remove it from prod/release build */
       NowGGAdsManager.Instance.EnableDebugMode();
      
       NowGGAdsManager.Instance.Initialize();
   }

Important Information

  • The EnableDebugMode() function should only be initialized for the testing environment.
  • You must remove this function before submitting the release version of your App build to now.gg Cloud.

Test the Integration

Once you have the debug mode enabled on your app, follow the steps below to test your Rewarded Ads integration:

  • Install BlueStacks 5 App Player on your test machine.
  • Install your app with ‘now.gg Rewarded Ads’ integration by simply dragging and dropping the APK over the BlueStacks 5 App Player.
  • Launch your app.
  • Depending on how you have configured the rewarded Ads with your app, test the scenarios where:
    • Ad is displayed on the user’s screen
    • The user has earned a reward
    • The ad was dismissed by the user, which resulted in either:
      • No reward being earned
      • Reward earned since it was dismissed after a specific time configured by the Ad network.

Note: The ads displayed within the testing environment on BlueStacks 5 are dummy ads. Actual Ads will only be displayed to the user after you publish your app to now.gg.


Demo Project

We have also included Demo projects for both Android Native and Unity, which you can find here. You can refer to it to understand now.gg Rewarded Ads flow.

×

Document Rev. 1.0

Text copied to clipboard
Link copied to clipbord
Questions? Please reach out to us at dev-support@now.gg