public RegisterAsync ( string handle, IEnumerable |
||
handle | string | The notification handle to register with.. |
tags | IEnumerable |
The tags to register. |
return | System.Threading.Tasks.Task |
/// <summary> /// Registers the signed in user on the device for push notifications /// </summary> private async void RegisterForNotifications() { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); try { var currentUserId = AppEnvironment.Instance.CurrentUser.UserId; var registrationClient = new NotificationRegistrationClient(); await registrationClient.RegisterAsync(channel.Uri, new[] { "user:" + currentUserId }); } catch (Exception) { // We can ignore this exception, as this may happend when not internet connection is available. } }
/// <summary> /// Registers the signed in user on the device for push notifications /// </summary> private async void RegisterForNotifications() { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); try { var currentUserId = AppEnvironment.Instance.CurrentUser.UserId; var registrationClient = new NotificationRegistrationClient(); await registrationClient.RegisterAsync(channel.Uri, new[] { "user:" + currentUserId }); } catch (Exception ex) { _telemetryClient.TrackException(ex); } }
/// <summary> /// Registers the signed in user on the device for push notifications /// </summary> private async void RegisterForNotifications() { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); try { var currentUserId = AppEnvironment.Instance.CurrentUser.UserId; var registrationClient = new NotificationRegistrationClient(); await registrationClient.RegisterAsync(channel.Uri, new[] { "user:" + currentUserId }); } catch (Exception) { // We can ignore this exception, as this may happend when not internet connection is available. } }