MAX - Unity

Based on AppLovin MAX Unity Demo App: https://github.com/AppLovin/AppLovin-MAX-Unity-Plugin you can test the Nefta Custom adapter integration through MAX SDK https://github.com/Nefta-io/NeftaMAXAdapter-Unity.

Include the SDK

Manually

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/NeftaMAXAdapter-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.

Unity Package Manager

Or with UPM via: https://github.com/Nefta-io/nefta.max-adapter.git :



On Android 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 { *; }

Code integration

To complete the integration, you have to init the SDK on app start or shortly after, to ensure proper behavior of game events:

#if UNITY_IOS
   private const string _neftaAppId = "5763106043068416";
#else // UNITY_ANDROID
   private const string _neftaAppId = "5693275310653440";
#endif

NeftaAdapterEvents.InitWithAppId(_neftaAppId, (InitConfiguration config) =>
{
   Debug.Log($"[NeftaPluginMAX] Should skip Nefta optimization: {config._skipOptimization} for: {config._nuid}");
}                

Game events

After this, you can create events whenever you like, for example:

new ProgressionEvent(Type.Task, Status.Start) { _name = "tutorial", _value = 1}.Record();

Testing

To enable logging call this function anytime during runtime:

NeftaAdapterEvents.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 = NeftaAdapterEvents.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/docs/advanced-features