Ejemplo n.º 1
0
 public void OnApplicationPause(bool paused)
 {
     if (PlatformHooks.IsAndroid)
     {
         PlatformHooks.CallStaticJavaUnityMethod("com.parse.AVPushUnityHelper", "setApplicationPaused", new object[] { paused });
     }
 }
Ejemplo n.º 2
0
        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());
            }
        }
Ejemplo n.º 3
0
        /// <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();
                    }
                });
            }
        }