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");

Additional parameters

For additional configuration, for example for configuring external test group, use:

NeftaPlugin.SetExtraParameter(NeftaPlugin.ExtParam_TestGroup, "split-direct");

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.

With all this done, you will start seeing Nefta test ads in your app.