Mobile Ads Settings
Before starting, first you must configure the SDK via EMASettings instance.
Important Note: You must set the initial activity of your app by the following code:
If you have the user's consent on displaying non-personalized ads, you may set
Some properties of
EMASettings are for testing and debugging purposes.
The optional parameters are:
isAdsDisabled: The default value is
false. Set this value
trueif you don't want your users to see ads.
isUserLoggedInWithFB: Default value is
false. Used for targeting. Set this value to
trueif the current user is logged in via Facebook.
logLevel: the default value is
LogLevel.NONE. Set this value to
LogLevel.ALLto print out all debug messages.
testingType: The default value is
AdTestingType.NONE. This may be used to test the DFP Banner Ads, DFP Interstitial Ads, AdMob Banner Ads, AdMob Interstitial Ads or IMA Preroll Ads. Please don't forget to remove this setting before submitting your app to the Google Play Store.
testDevies: If you'd like to test the ads via your device's testing id then add the value to this property. Please don't forget to remove this setting before submitting your app to Google Play Store!
Initializing the SDK
After configuring the SDK with at least the required parameters, you must call
init method of
EMAManager.instance, which initializes the SDK and sends a broadcast message of type
EMAAdBroadcastType.ADS_READY_FOR_DISPLAY once the initialization is complete. This only needs to be done once, ideally at the application launch. Please also note that
EMAManager.instance.isAdsReadyForDisplay is set to
true once the initialiation process is completed.
aplication: Application class of the app.
appAdIdentifier: Your app idenfier which will be provided by us.
adAppVersion(Optional): ad version for the related app which is initially "1"
testMode(Optional): to enable debugging logs and test ads.
EMAManager.getInstance().init(this, appAdIdenfier, adAppVersion, testMode)
You can also add AppViewParserListener through EMAManager.instance.appViewParserListener property to listen sendAppView events with
onFailedAppViewParse. Note that sendAppView may get called multiple times in one session.