Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            //go to background when pressing back button
                        #if UNITY_ANDROID
            AndroidJavaObject activity =
                new AndroidJavaClass("com.unity3d.player.UnityPlayer")
                .GetStatic <AndroidJavaObject>("currentActivity");
            activity.Call <bool>("moveTaskToBack", true);
                        #endif
        }


                #if UNITY_IOS
        if (!tokenSent)
        {
            byte[] token = UnityEngine.iOS.NotificationServices.deviceToken;
            if (token != null)
            {
                //For iOS uninstall
                AppsFlyer.registerUninstall(token);
                tokenSent = true;
            }
        }
                #endif
    }
Esempio n. 2
0
        IEnumerator CRWaitForNotificationToken()
        {
            WaitForSecondsRealtime waitTime = new WaitForSecondsRealtime(0.2f);

            byte[] token = null;
            do
            {
                yield return(waitTime);

                token = UnityEngine.iOS.NotificationServices.deviceToken;
            } while (token == null);
            AppsFlyer.registerUninstall(token);
        }
Esempio n. 3
0
 private void Update()
 {
                 #if UNITY_IOS
     if (this.tokenSent == false)
     {
         byte[] token = UnityEngine.iOS.NotificationServices.deviceToken;
         if (token != null)
         {
             //For iOS uninstall
             AppsFlyer.registerUninstall(token);
             this.tokenSent = true;
         }
     }
                 #endif
 }
Esempio n. 4
0
 void Update()
 {
     /* iOS uninstall tracking */
     #if UNITY_IOS
     if (!tokenSent)
     {
         byte[] token = UnityEngine.iOS.NotificationServices.deviceToken;
         if (token != null)
         {
             AppsFlyer.registerUninstall(token);
             tokenSent = true;
         }
     }
     #endif
 }
Esempio n. 5
0
 public override void OnUpdate()
 {
     base.OnUpdate();
     #if UNITY_IOS
     if (!tokenSent)
     {
         byte[] token = UnityEngine.iOS.NotificationServices.deviceToken;
         if (token != null)
         {
             //For iOS uninstall
             AppsFlyer.registerUninstall(token);
             tokenSent = true;
         }
     }
     #endif
 }