public void RegisterForPushNotification() { GcmClient.CheckDevice(Forms.Context); GcmClient.CheckManifest(Forms.Context); GcmService.Initialize(Forms.Context); GcmService.Register(Forms.Context); }
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); }
public static void ProcessNotification(GcmService service, NotificationManager notificationManager, Intent uiIntent, NotificationCompat.Builder builder, string title, string description, Bitmap largIcon) { var notification = builder.SetContentIntent(PendingIntent.GetActivity(service, 0, uiIntent, 0)) .SetSmallIcon(Resource.Drawable.icon) .SetLargeIcon(largIcon) .SetTicker(title) .SetContentTitle(title) .SetContentText(description) .SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Notification)) .SetAutoCancel(true).Build(); notificationManager.Notify(1, notification); }
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"); } }
public GcmPushes(GcmService gcmService) { GService = gcmService; }