// 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 }
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); }
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 }
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 }
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 }