public override async void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { CancellationTokenSource cts = new CancellationTokenSource(); await PushRegistrationService.RegisterDeviceAsync(cts.Token, PushPlatforms.IOS, deviceToken.ToString(), new List <string> { nameof(PushPlatforms.IOS) }); }
private async Task InitNotificationAsync(CancellationToken cancellationToken) { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); await PushRegistrationService.RegisterDeviceAsync(cancellationToken, PushPlatforms.WINDOWS, channel.Uri, new List <string> { nameof(PushPlatforms.WINDOWS) }); }
protected override async void OnRegistered(Context context, string registrationId) { Log.Verbose(PushHandlerBroadcastReceiver.TAG, "GCM Registered: " + registrationId); RegistrationID = registrationId; createNotification("PushHandlerService-GCM Registered...", "The device has been Registered!"); CancellationTokenSource cts = new CancellationTokenSource(); await PushRegistrationService.RegisterDeviceAsync(cts.Token, PushPlatforms.ANDROID, RegistrationID, new List <string> { nameof(PushPlatforms.ANDROID) }); }