AdMob - Android
Based on the AdMob demo project: https://github.com/googleads/googleads-mobile-android-examples you can check Nefta custom adapter integration example here: https://github.com/Nefta-io/NeftaAMAdapter-Android.
Include the SDK
Gradle
Add the following repository to the settings.gradle
:
dependencyResolutionManagement {
repositories {
...
maven { url 'https://maven.nefta.app/android-sdk' }
}
}
Then add the libraries to your app build.gradle
:
dependencies {
...
implementation 'com.nefta:nefta-sdk-am:4.3.0'
}
Manually
Or you can integrate manually: https://docs.nefta.io/update/docs/manual-android-integration-2#/
Permissions
Make sure that you're having all the required permissions declared:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Code integration
Since AdMob SDK doesn't preemptively initialize custom adapter, you have to do it yourself like this:
NeftaPlugin.Init(getApplicationContext(), "yourApplicationId");
NeftaPlugin._instance.EnableAds(true);
With this you're also ready to wire recording of game events like this:
NeftaPlugin.Events.AddProgressionEvent(
NeftaEvents.ProgressionStatus.Completed,
NeftaEvents.ProgressionType.Achievement,
NeftaEvents.ProgressionSource.Boss,
"SuperBoss",
1L,
"anything else");
All done
With this technical part completed, make sure that you have the Nefta mediation enabled in your AdMob Configuration.
You can also verify the correct SDK behaviour through logs.
Additional Features
List of additional features: https://docs.nefta.io/update/docs/advanced-features#/
Updated 11 days ago