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:

Configuration

To access configuration go to menu: Window > Nefta > Select Nefta Configuration:

Which will select the configuration:

Here you should enter your Nefta App Id from the dashboard.


Code integration

Before using the adapter you have to initialize it with:

// Nefta Custom Adapter Initialization
Nefta.Adapter.Init();

It is also good to do this as soon as possible in the application lifecycle. After this, the adapter will be ready to be used by AdMob SDK or for game event recording, which you can call like this:

Nefta.Adapter.Record(new ProgressionEvent()
{
   _type = Type.Task,
   _source = Source.CoreContent,
   _status = Status.Complete,
   _value = 2,
   _customString = "area42"
})

Testing

To enable logging call this function anytime during runtime:

Adapter.EnableLogging(true);

To get the nuid (player install identifier) with which you can modify Nefta behaviour and verify integration on the dashboard:

// if parameter is true it will also show the nuid in native pop up window
var nuid = Adapter.GetNuid(false); // will return and log the nuid

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


Additional Features

List of additional features: https://docs.nefta.io/update/docs/advanced-features#/