AdMob - Unity

Based on Google AdMob Unity Demo App: https://github.com/googleads/googleads-mobile-unity you can test the Nefta Custom adapter integration through Google AdMob SDK: https://github.com/Nefta-io/NeftaMAXAdapter-Unity>.

Include the SDK

The most convenient way to include the Nefta Custom Adapter for both Android and iOS is to download the Unity package: https://github.com/Nefta-io/NeftaAMAdapter-Unity/releases. Which you import through Assets > Import Package > Custom Package...

After which you will be presented with the following dialog:

Feel free to customize this as much as you want, based on the needs of your project.

Android

Things should work as long as you have NeftaPlugin-release-x.y.z.aar in the Plugins/Android folder.

If you are using custom proguard file, add the following into proguard-user.txt:

-keep public class com.nefta.sdk.NeftaPlugin { *; }
-keep public interface com.nefta.sdk.AdapterCallback { *; }

iOS

Similarly, here, the Unity build process should automatically include NeftaSDK by itself. As long as the Add to Embedded Binaries is checked:


Code integration

Initialize the SDK soon as possible (for accurate session tracking) with:

Adapter.InitWithAppId(_neftaAppId, (InitConfiguration initConfig) => {
   Debug.Log($"Nefta initialized, nuid: {initConfig._nuid}");
});

Testing

To enable logging call this function anytime during runtime:

Adapter.EnableLogging(true);

The most convenient way to find the Nefta SDK version is through menu: Window > Nefta > Inspect: