Banner Ad Callbacks

Setting Up a RequestListener and creating an InneractiveAdViewEventsListener

The following example illustrates how a RequestListener should be used.

In addition, it shows how to add an event listener properly for receiving Banner ad callbacks.

RequestListener Example
// display Square callbacks
InneractiveAdSpot.RequestListener spotListener = new InneractiveAdSpot.RequestListener() {
  
            @Override
            public void onInneractiveFailedAdRequest(InneractiveAdSpot adSpot, InneractiveErrorCode errorCode) {
                Log.i(TAG, "Failed loading Square! with error: " + errorCode);
            }
 
            @Override
            public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot adSpot) {
 
                InneractiveAdViewUnitController controller =
                    (InneractiveAdViewUnitController)mSpot.getSelectedUnitController();
 
                controller.setEventsListener(new InneractiveAdViewEventsListener() {
                  
                    @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
                    public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) {
                        Log.i(TAG, "onAdWillOpenExternalApp");
                    }

                    @Override //Since VAMP 7.2.0
                    public void onAdEnteredErrorState(InneractiveAdSpot adSpot, AdDisplayError error) {
                                                Log.i(TAG, "onAdEnteredErrorState");
                    }

onAdEnteredErrorState

Starting from Android Marketplace SDK version 7.5.4, this callback is also invoked in cases where the WebView renderer process has crashed.
in such cases the instance of the AdDisplayError appears as WebViewRendererProcessHasGoneError.
If this error was triggered for a banner, we recommend to destroy the banner and request a new one. No additional steps are required for full screen ad units.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request