Esempio n. 1
0
 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)
     });
 }
Esempio n. 2
0
        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)
            });
        }
Esempio n. 3
0
        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)
            });
        }