示例#1
0
        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) =>
            {
            };
        }
示例#2
0
        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;
            }
        }