Android events

Direct Nefta Android SDK Integration

Integration as adapter through IronSource

Add the following repository and the dependency into your application build to include Nefta Ad SDK as an adapter through IronSource SDK.gradle file:

repositories {
  maven {
    ...
		url "https://android-sdk.nefta.io/"
  }
}

dependencies {
  ...
  implementation 'com.nefta.sdk:isadaptersdk:1.0.0'
}

By default IronSource SDK will only initialize Nefta adapter after you add it to the mediation network in your LevelPlay configuration. That is why you have to manually initialize the Nefta SDK, to make sure it's ready to record events from the start. You can do this by adding the following code:

NeftaPlugin.Init(getApplicationContext(), "5667525748588542"); // the second parameter is your nefta app_id

You can verify that Ad SDK is initialized and ready to record events with the following adb logs:

Integration as adapter through MAX

tbd

Usage

Regardless of the integration, you always add an event like this:

Source for all possible events:

		public enum ProgressionStatus {
        UNDEFINED(null),
        START("progression-start"),
        COMPLETED("progression-completed"),
        FAIL("progression-fail");

        public final String _value;
        ProgressionStatus(final String value) {
            _value = value;
        }
    }

    public enum ProgressionType {
        UNDEFINED(null),
        GAMEPLAY_UNIT("gameplay-unit"),
        TASK("task"),
        ACHIEVEMENT("achievement"),
        PLAYER_LEVEL("player-level"),
        ITEM_LEVEL("item-level"),
        OTHER("other");

        public final String _value;
        ProgressionType(final String value) {
            _value = value;
        }
    }

    public enum ProgressionSource {
        UNDEFINED(null),
        CORE_CONTENT("core-content"),
        OPTIONAL_CONTENT("optional-content"),
        BOSS("boss"),
        SOCIAL("social"),
        SPECIAL_EVENT("special-event"),
        OTHER("other");

        public final String _value;
        ProgressionSource(final String value) {
            _value = value;
        }
    }

    /**
     * Sends progression event
     *
     * @param status Defines the progression outcome.
     * @param type Defines the type of progression.
     * @param source Defines content type of progression.
     * @param name Defines the specific named content of progression.
     * @param value Qauntifiable progression step or number.
     * @param customPayload Any other custom data.
     */
    public void AddProgressionEvent(ProgressionStatus status, ProgressionType type, ProgressionSource source, final String name, long value, String customPayload) {
        CreateBaseEvent(status._value, type._value, source._value, name, value, customPayload);
    }

    public enum ResourceCategory {
        UNDEFINED(null),
        SOFT_CURRENCY("soft-currency"),
        PREMIUM_CURRENCY("premium-currency"),
        RESOURCE("resource"),
        CORE_ITEM("core-item"),
        COSMETIC_ITEM("cosmetic-item"),
        CONSUMABLE("consumable"),
        EXPERIENCE("experience"),
        CHEST("chest"),
        OTHER("other");
        public final String _value;
        ResourceCategory(final String value) {
            _value = value;
        }
    }

    public enum ReceiveMethod {
        UNDEFINED(null),
        LEVEL_END("level-end"),
        REWARD("reward"),
        LOOT("loot"),
        SHOP("shop"),
        IAP("iap"),
        CREATE("create"),
        OTHER("other");
        public final String _value;
        ReceiveMethod(final String value) {
            _value = value;
        }
    }

    /**
     * Sends an event when the player receives any valuable
     *
     * @param category Defines the category of valuable the player obtained.
     * @param method Defines the source of obtained valuable.
     * @param name The name of received valuable.
     * @param quantity Received quantity.
     * @param customPayload Any other custom data.
     */
    public void AddReceiveEvent(ResourceCategory category, ReceiveMethod method, final String name, long quantity, final String customPayload) {
        CreateBaseEvent("receive", category._value, method._value, name, quantity, customPayload);
    }

    public enum SpendMethod {
        UNDEFINED(null),
        BOOST("boost"),
        CONTINUITY("continuity"),
        CREATE("create"),
        UNLOCK("unlock"),
        UPGRADE("upgrade"),
        SHOP("shop"),
        LOOTED("looted"),
        OTHER("other");
        public final String _value;
        SpendMethod(final String value) {
            _value = value;
        }
    }

    /**
     * Sends an event when the player spends any valuable
     *
     * @param category Defines the category of valuable the player spend.
     * @param method Defines the source of spending.
     * @param name The name of spent valuable.
     * @param quantity Spend quantity.
     * @param customPayload Any other custom data.
     */
    public void AddSpendEvent(ResourceCategory category, SpendMethod method, final String name, long quantity, final String customPayload) {
        CreateBaseEvent("spend", category._value, method._value, name, quantity, customPayload);
    }

Reach out to a member of our team if you have any questions.