Testing Integration

After you have integrated the now.gg Rewarded Ads SDK with your app; you can use the steps listed here to test this integration.

Prerequisites

  • BlueStacks 5 (BS5 App player).
  • Your app with now.gg Rewarded Ads SDK integration and debug mode enabled.

Enable Debug Mode

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

To enable debug mode, add RewardsClient.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 and remove it from prod/release apk */
     RewardsClient.enableDebugMode();
    
     RewardsClient.initialize(this, initializationStatus -> {
         Log.d(TAG, "onInitializationComplete: " + initializationStatus);

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

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 APK to now.gg Cloud.

To test now.gg Login integration

  • Install BlueStacks 5 App Player on your test machine.
  • Install your app with ‘now.gg Rewarded Ads SDK’ 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.

SDK Demo App

We have also included an SDK Demo app (RewardsTest.apk) and its source code in the download package. You can install this app to understand the Rewarded Ads flow.

  • The steps to install the SDK Demo App are identical to the steps to install your app (listed above).
  • We have showcased the scenarios where:
    • The ad was 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.
×

Table of Contents

Testing Integration

Table of Contents

Document Rev. 1.0

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