Пример #1
0
 public void RegisterForPushNotification()
 {
     GcmClient.CheckDevice(Forms.Context);
     GcmClient.CheckManifest(Forms.Context);
     GcmService.Initialize(Forms.Context);
     GcmService.Register(Forms.Context);
 }
Пример #2
0
        private void RegisterWithGCM()
        {
            // Check to ensure everything's set up right
            GcmClient.CheckDevice(this);
            GcmClient.CheckManifest(this);

            // Register for push notifications
            System.Diagnostics.Debug.WriteLine("MainActivity", "Registering...");
            GcmService.Initialize(this);
            GcmService.Register(this);
        }
 private void RegisterPushNotifications()
 {
     try
     {
         GcmService.Initialize(this);
         GcmService.Register(this);
     }
     catch (Java.Net.MalformedURLException)
     {
         CreateAndShowDialog("There was an error creating the client. Verify the URL.", "Error");
     }
     catch (Exception e)
     {
         CreateAndShowDialog(e.Message, "Error");
     }
 }