Nimbus Android SDK

Logging

Logging is disabled by default so as not to affect production apps.

To receive logs from the Nimbus SDK, call Nimbus.addLogger() and provide an implementation of the Logger interface. Nimbus provides a default logger implementation which will write the output to the console.

Nimbus.addLogger(new Nimbus.Logger {
    @Override
    public void log(int priority, @NonNull String message) {
        // Your log code here
    }
})

// or

Nimbus.addLogger(new Nimbus.Logger.Default(Log.INFO));

Debugging Nimbus Errors

All NimbusError objects may optionally wrap an inner exception explaining the cause of the error. For more details on an error use the following code in your error listeners

@Override
void onError(NimbusError error) {
    if (error.getCause() != null) {
        //check nested error details here
    }       
}

Test Mode

To receive test ads, call Nimbus.setTestMode(true); this will bypass the live auction and return test creatives based on the requests sent to Nimbus.

Proguard/R8

If using Proguard, include the following rules in your proguard config file:

-keepattributes Signature, *Annotation*

-keep class com.google.ads.interactivemedia.** { *; }
-keep class com.google.obf.** { *; }
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
-dontwarn org.codehaus.mojo.animal_sniffer.*
-dontwarn okhttp3.internal.platform.ConscryptPlatform
-dontwarn sun.misc.**
-dontwarn javax.annotation.**

-keepclassmembers class com.adsbynimbus.openrtb.request.* {
    public *;
}

-keepclassmembers class com.adsbynimbus.openrtb.response.NimbusResponse** {
    public *;
}

-keep class * extends com.adsbynimbus.internal.Component { public *; }
-keepclassmembers class com.adsbynimbus.render.web.MraidBridge { *; }
-keepclassmembers class com.adsbynimbus.render.web.NimbusWebViewClient { *; }

# If using the Nimbus GAM Adapter
-keep class com.adsbynimbus.google.NimbusCustomEventBanner {
    <methods>;
    !static <methods>;
}

### Known Issues

If you are using a version of the Android Gradle Plugin below 3.5, or if you are building on a Windows machine
and are on a version of AGP below 3.6.3, please include the following proguard config.

```text
-keep class * extends com.adsbynimbus.internal.Component { public *; }