private IEnumerator Start()
        {
            PlayFabGoogleCloudMessaging._RegistrationCallback += (token, error) => { this.deviceToken = token; };

            PlayFabGoogleCloudMessaging._MessageCallback += (message) => { this.pushHandler.ReceivedPushNotification(message); };

            PlayFabGoogleCloudMessaging._RegistrationReadyCallback += (status) =>
            {
                if (status)
                {
                    PlayFabGoogleCloudMessaging.GetToken();     // request device token
                    PlayFabAndroidPlugin.UpdateRouting(false);  // suppress push notifications while app is running
                }
            };

            // TODO [bgish]:  This should probably be located in AppSettings, if not defined print error and early out GameObject.Destroy(this);
            PlayFabAndroidPlugin.Init("GoogleAppId");

            int retryCount = 0;

            while (this.deviceToken == null)
            {
                retryCount++;

                if (retryCount >= RetryCountMax)
                {
                    break;
                }

                yield return(new WaitForSeconds(RetryWaitTime));
            }

            // if we got here and still no deviceToken, then we timed out
            if (this.deviceToken == null)
            {
                Debug.LogError("PlayFabAndroidPushHandler timed out waiting for the RegistrationCallback to complete.");

                // cleaning up this Android push notification handler so it doesn't take up any cycles
                GameObject.Destroy(this);
                yield break;
            }

            PlayFabClientAPI.AndroidDevicePushNotificationRegistration(
                new AndroidDevicePushNotificationRegistrationRequest {
                DeviceToken = this.deviceToken
            },
                (result) =>
            {
                Debug.Log("Push Notification Registration Successful!");
            },
                (error) =>
            {
                Debug.Log("Error Registering for Android Push Notifications!");
                Debug.Log(error.Error);
                Debug.Log(error.ErrorMessage);
                Debug.Log(error.ErrorDetails);
            });
        }
 private void OnApplicationFocus(bool focus)
 {
     // checking that we actually got a device token before updating routing
     if (string.IsNullOrEmpty(this.deviceToken) == false)
     {
         // if we lose focus, then we don't want to consume push notifications anymore
         PlayFabAndroidPlugin.UpdateRouting(!focus);
     }
 }