Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to initialize MoPub?

Tags:

android

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?

like image 425
xuka Avatar asked Dec 05 '25 03:12

xuka


1 Answers

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.

like image 81
Vincent Plus Avatar answered Dec 07 '25 17:12

Vincent Plus