public void Initialize() { CrossFirebasePushNotification.Current.OnTokenRefresh += (s, p) => { try { string newToken = CrossFirebasePushNotification.Current.Token; _expenseTrackerService.UpdateUserFCMToken(newToken); } catch (Exception ex) { _telemetry.LogError("Error PushService OnTokenRefresh", ex); } }; CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) => { }; CrossFirebasePushNotification.Current.OnNotificationOpened += (s, p) => { }; CrossFirebasePushNotification.Current.OnNotificationAction += (s, p) => { }; CrossFirebasePushNotification.Current.OnNotificationDeleted += (s, p) => { }; }
private async Task ExecuteRefreshPushToken() { try { await _expenseTrackerService.UpdateUserFCMToken(CrossFirebasePushNotification.Current.Token); await base.ShowMessageAsync("Push Token Updated!"); } catch (Exception ex) { _telemetry.LogError("ExecuteRefreshCachedLists error", ex); await base.ShowErrorMessageAsync("Error."); } finally { IsBusy = false; } }