Fullscreen Ads - Callbacks

Setting Up a RequestListener and creating an InneractiveFullscreenUnitController

The following example demonstrates how a RequestListener should be used and how to add an event listener properly for receiving Interstitial or Rewarded ad callbacks.

The InneractiveFullScreenAdRewardedListener can be optionally be used to receive rewarded ad callbacks.

Listening for Requests Example
InneractiveAdSpot.RequestListener spotListener = new InneractiveAdSpot.RequestListener() {
             
            @Override
            public void onInneractiveFailedAdRequest(InneractiveAdSpot adSpot, InneractiveErrorCode errorCode) {
                Log.i(TAG, "Failed loading fullscreen ad! with error: " + errorCode);
            }
 
            @Override
            public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot adSpot) {
                // Register for full screen ad callbacks
                InneractiveFullscreenUnitController controller =
                    (InneractiveFullscreenUnitController)mSpot.getSelectedUnitController();
              
                //Starting with version 7.6.0 of the MarketPlace SDK a rewarded completion listener has also been added - 
                    InneractiveFullscreenUnitController fullscreenUnitController = new InneractiveFullscreenUnitController();
                                    controller.setRewardedListener(new InneractiveFullScreenAdRewardedListener() {
                                    
                     @Override
                           public void onAdRewarded(InneractiveAdSpot adSpot) {
                                  Log.i(TAG, "onAdRewarded");
                           }
                    
                  });
              
                controller.setEventsListener(new InneractiveFullscreenAdEventsListener() {
                    @Override
                    public void onAdImpression(InneractiveAdSpot adSpot) {
                        Log.i(TAG, "onAdImpression");
                    }
                  
                    @Override
                    public void onAdClicked(InneractiveAdSpot adSpot) {
                        Log.i(TAG, "onAdClicked");
                    }
                  
                    @Override
                    public void onAdWillCloseInternalBrowser(InneractiveAdSpot adSpot) {
                        Log.i(TAG, "onAdWillCloseInternalBrowser");
                    }
                  
                    @Override
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request