public void OnApplicationPause(bool paused) { if (PlatformHooks.IsAndroid) { PlatformHooks.CallStaticJavaUnityMethod("com.parse.AVPushUnityHelper", "setApplicationPaused", new object[] { paused }); } }
private void Initialize() { if (!isInitialized) { isInitialized = true; // Keep this gameObject around, even when the scene changes. GameObject.DontDestroyOnLoad(gameObject); AVClient.Initialize(applicationID, applicationKey); // Kick off the dispatcher. StartCoroutine(PlatformHooks.RunDispatcher()); } }
/// <summary> /// Initializes the LeanCloud SDK and begins running network requests created by LeanCloud. /// </summary> public virtual void Awake() { Initialize(); // Force the name to be `AVInitializeBehaviour` in runtime. gameObject.name = "AVInitializeBehaviour"; if (PlatformHooks.IsIOS) { PlatformHooks.RegisterDeviceTokenRequest((deviceToken) => { if (deviceToken != null) { AVInstallation installation = AVInstallation.CurrentInstallation; installation.SetDeviceTokenFromData(deviceToken); // Optimistically assume this will finish. installation.SaveAsync(); } }); } }