MoPub Header Bidder Manual Integration

Manual header bidder integration is available for Banner and Interstitial ads. Do go through the steps in our getting started guide to add Media.Net SDK into your project before starting the header bidder integration.

Add build.gradle dependency

You require adding mopub dependency for manual integration of DFP header bidder.

   dependencies  {
     compile "net.media.android:mopub:1.2.5"
   }

Manual integration of header bidding for Banner Ads

The example below shows a way of integrating manual header bidding for banner ads.

   MNetHbMoPub.addBids(moPubView, new MoPubHbCallback() {

            /*
             * Sent when bidding is successful
             */
            @Override public void onSuccess() {
                 //Do your stuff
            }

            /*
             * Sent when header bidding fails
             */
            @Override public void onError(MNetError mNetError) {
                 //Do your stuff
            }
        });

Manual integration of header bidding for Interstitial Ads

The example below shows a way of integrating manual header bidding for interstitial ads.

   MNetHbMoPub.addBids(moPubInterstitial, new MoPubHbCallback() {

            /*
             * Sent when bidding is successful
             */
            @Override public void onSuccess() {
                 //Do your stuff
            }

            /*
             * Sent when header bidding fails
             */
            @Override public void onError(MNetError mNetError) {
                 //Do your stuff
            }
        });