Search code examples
androidmopub

How to initialize MoPub?


I'm pretty new in Mopub. Just trying to add Mopub ads in Android. So, I've been following this documentation: https://developers.mopub.com/publishers/android/initialize/

The documentation suggests to write something like this:

MoPub.initializeSdk(context, new SdkConfiguration.Builder("AD_UNIT_ID")
                .build(), null);

But I its not clear, which AD_UNIT_ID to write in the code? Banner, Interstitial or Reward ad unit ID? or do I have to initialize each time before showing any kinds of ads?


Solution

  • From MoPub integration document:

    You only need to initialize once using any valid ad unit ID from your app. Ad requests should only be made once the SDK initialization has completed.

    It means you can init MoPub SDK with your interstitial or reward ad unit id, etc.