Пример #1
0
 protected internal override void onHandleIntent(Intent intent)
 {
     try
     {
         InstanceID instanceID = InstanceID.getInstance(this);
         string     token      = instanceID.getToken(getString([email protected]_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
         sendGCMTokenToActivity(token);
     }
     catch (Exception e)
     {
         /*
          * If we are unable to retrieve the GCM token we notify the Activity
          * letting the user know this step failed.
          */
         Log.e(TAG, "Failed to retrieve GCM token", e);
         sendGCMTokenToActivity(null);
     }
 }