Uninstall Measurement

iOS

AppsFlyer enables you to track app uninstalls. To handle notifications it requires to modify your AppDelegate.m. Use didRegisterForRemoteNotificationsWithDeviceToken to register to the uninstall feature.

UnityEngine.iOS.NotificationServices is now deprecated. Please use the "Mobile Notifications" package instead. It is available in the Unity package manager.

예:

using AppsFlyerSDK;
using Unity.Notifications.iOS;

public class AppsFlyerObjectScript : MonoBehaviour, IAppsFlyerConversionData
{

    void Start()
    {
        AppsFlyer.initSDK("devKey", "appID", this);
        AppsFlyer.startSDK();
#if UNITY_IOS
  
        StartCoroutine(RequestAuthorization());
        Screen.orientation = ScreenOrientation.Portrait;

#endif

    }


#if UNITY_IOS
    IEnumerator RequestAuthorization()
    {
      
        using (var req = new AuthorizationRequest(AuthorizationOption.Alert | AuthorizationOption.Badge, true))
        {

            while (!req.IsFinished)
            {
                yield return null;
            }
             if (req.Granted && req.DeviceToken != "")
             {
                  AppsFlyeriOS.registerUninstall(Encoding.UTF8.GetBytes(req.DeviceToken));
      
             }
        }
    }
#endif
}

Read more about Uninstall register: Appsflyer SDK support site


안드로이드

  1. Download the Unity Firebase SDK from: https://firebase.google.com/docs/unity/setup.
  2. Import FirebaseMessaging.unitypackage into the project.
  3. Import google-services.json into the project (obtained in the Firebase console)
    Note Manifest receivers should be automatically added by the Unity Firebase SDK.
  4. In the Unity class handling the AppsFlyer code, add the following:
using Firebase.Messaging;
using Firebase.Unity;
  1. Add to the Start() method:
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
  1. 다음 메서드를 추가합니다:
    public void OnTokenReceived(object sender, Firebase.Messaging.TokenReceivedEventArgs token)
    {
#if UNITY_ANDROID
        AppsFlyerAndroid.updateServerUninstallToken(token.Token);
#endif
    }

Read more about Android Uninstall Tracking: Appsflyer SDK support site