App Return Ads - cleveradssolutions/CAS-Android GitHub Wiki

:zap: Before you start
Make sure you have correctly Initialize SDK.


The Return Ads which is displayed once the user returns to your application after a certain period of time.
To minimize the intrusiveness, short time periods are ignored.
Return ads are disabled by default.

[!IMPORTANT]

  • The Ad on Return to App is a regular Interstitial Ad.
  • Automatic display is only possible when using autoload Interstitial Ad.
  • The Ad will be displayed only if the Interstitial Ad is currently loaded. After displaying the Interstitial Ad, it will be necessary to load a new advertisement.
  • The Ad will not be shown if the interval since the last closure of the Interstitial Ad has not elapsed.
  • Do not activate this ad format if your application displays an AppOpen Ad when returning to the app.

Enable the ad

If you want to enable the Return Ads, simply pass AdCallback as the parameter of the method.

manager.enableAppReturnAds(new AdCallback() {  
    @Override  
    public void onShown(@NonNull AdStatusHandler ad) {  
        // Called when ad is shown.
    }  
  
    @Override  
    public void onShowFailed(@NonNull String message) {  
        // Called when ad fails to show. 
    }  
  
    @Override  
    public void onClicked() {  
        // Called when a click is recorded for an ad.  
    }  
  
    @Override  
    public void onComplete() {  
        // Called when ad is completed
    }  
  
    @Override  
    public void onClosed() {  
        // Called when ad is dismissed
    }  
});

Disable the ad

When you no longer want to show ads to users after they return to the app, call the following method.

manager.disableAppReturnAds();

Skip next return

You can call this method when you intentionally redirect the user to another application (for example Google Play) and do not want them to see ads when they return to your application.

manager.skipNextAppReturnAds();

🔗 Done! What’s Next?