Nimbus Android SDK

Third Party Demand SDK Integrations

Amazon APS

The Nimbus SDK will automatically import the Amazon APS library and handle injecting all the necessary parameters into the outgoing NimbusRequest after initialization. The APS extension can be installed on all Android devices but will only run on devices with KitKat or above.

Include the APS SDK and Nimbus APS Extension

dependencies {
    implementation "com.adsbynimbus.android:extension-aps:1.11.6"
}

Configure the SDK to include APS Demand

Include all the line items that are setup with APS

ApsDemandProvider.initialize(getApplicationContext(), "aps_app_key",
                            new DTBAdSize(320, 50, "banner_slot_id"),
                            new DTBAdSize(300, 250, "300x250_slot_id"),
                            new DTBAdSize.DTBInterstitialAdSize("interstitial_slot_id"),
                            new DTBAdSize.DTBVideo(getResources().getDisplayMetrics().widthPixels,
                                        getResources().getDisplayMetrics().heightPixels, "video_slot_id")))

// Enable APS Debug and Logging
if (BuildConfig.DEBUG) {
    AdRegistration.enableLogging(true);
    AdRegistration.enableTesting(true);
}

How it works

The SDK will automatically handle making requests to APS and injecting the correct values into a request made through the NimbusAdManager. When the ApsDemandProvider is initialized it will request an ad for each DTBAdSize provided. When an outbound request to Nimbus is made, the NimbusAdManager will inject the APS demand into the request if the size of the ad requests matches a winning bid from APS. If APS wins the auction, the cached ad is invalidated and a new one is requested.

Facebook Audience Network

The Nimbus SDK will automatically import the Facebook Audience Network and handle injecting all the necessary parameters into the outgoing NimbusRequest after initialization.

Include the Facebook Audience Network and Nimbus Facebook Extension

dependencies {
    implementation "com.adsbynimbus.android:extension-facebook:1.11.6"
}

Update or add network_security_config

Add the following to your network_security_config file or create a new one and link to it from the application tag in your AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>

   <domain-config cleartextTrafficPermitted="true">
       <domain includeSubdomains="true">127.0.0.1</domain>
   </domain-config>

</network-security-config>

Configure the SDK to include Facebook Audience Network Demand

Initialize the FANDemandProvider with your app id provided to you from Facebook. If you have any placements that use the legacy BANNER_320_50 Facebook AdSize, add the placement ids using setLegacyBannerPlacementIds().

FANDemandProvider.initialize(getApplicationContext(), "your_fb_app_id");

// Add any legacy Facebook 320x50 Banner placement ids 
FANAdRenderer.setLegacyBannerPlacementIds(...);

//To Customize Native Rendering
FANAdRenderer.setDelegate(new FANAdRenderer.Delegate() {

    //Set a custom view for rendering Native ads
    @Override
    public View customViewForRendering(ViewGroup container, NativeAd nativeAd) {
        return new View();
    };
});

Requesting Audience Network Ads

Facebook Audience Network ads are automatically included in the auction if the FANDemandProvider has been initialized and placement ids for FAN have been setup in Nimbus.

FAN banner and native units can be embedded in a layout and must use the following call:

nimbusAdManager.showAd(NimbusRequest.forBannerAd(...), layout, listener);

Interstitial and Rewarded video

FAN interstitial and rewarded video ads are full screen takeovers and must use the following call:

nimbusAdManager.showBlockingAd(NimbusRequest.forInterstitialAd(...), fragmentActivity, listener);

Testing the integration

To test the integration, follow steps from this guide to setup a device for receiving test integrations.

Please ensure the placements have been added in the Nimbus dashboard and are not paused

How it works

The SDK will automatically inject the bidder token and app id into the outbound request to Nimbus when using the NimbusAdManager. When the FANDemandProvider is initialized it will fetch the bidder token in the background for use on future requests and install the FANAdRenderer to render any wins from Facebook. If you would like to customize the rendering of the the FANAdRenderer, you can instantiate your own delegate and override the customViewForRendering() method to create a custom native ad layout. Please note the publisher is responsible for setting all of the relevant information on the views created in a custom layout.

Unity Ads

The Nimbus SDK will automatically import the Unity Ads SDK and handle injecting all the necessary parameters into the outgoing NimbusRequest after initialization. Currently the Nimbus SDK only supports Unity Rewarded Video.

Include the Unity Ads and Nimbus Unity Extension

dependencies {
    implementation "com.adsbynimbus.android:extension-unity:1.11.6"
}

Configure the SDK to include Unity Demand

Initialize the UnityDemandProvider with your game id provided to you from the Unity Dashboard. Placements for Unity Ads will can be defined using the Nimbus Dashboard.

UnityDemandProvider.initialize(getApplicationContext(), /*your game id*/);

### Requesting Unity Ads

Unity Ads are automatically included in the auction if the UnityDemandProvider has been initialized
and placement ids for Unity have been setup in Nimbus.

#### Rewarded video

Unity rewarded video ads are full screen takeovers and must use the following call:

```java
nimbusAdManager.showRewardedAd(NimbusRequest.forRewardedVideoAd(...), 15 /* Close button delay */, activity, listener);

Testing the integration

To test the integration, you can initialize the UnityDemandProvider using the initializeTestMode function instead of initialize which will traffic test ads through Nimbus.

Please ensure the placements have been added in the Nimbus dashboard and are not paused

How it works

The SDK will automatically injects a Unity token into the outbound request to Nimbus when using the NimbusAdManager. When the UnityDemandProvider is initialized it will initialize the Unity SDK which handles requesting tokens for use with Nimbus.