Пример #1
0
        public async Task HandleNotificationTappedAsync(Dictionary <string, object> androidPayload)
        {
            using (var _ = AnalyticsService.StartTrace(this, "Push Notification Tapped"))
            {
                try
                {
                    if (androidPayload == null)
                    {
                        throw new ArgumentNullException();
                    }

                    if (androidPayload.ContainsKey("Template_Name"))
                    {
                        await InvokeTapHandlersAsync(ExtractNotification(androidPayload));
                    }
                    else
                    {
                        AnalyticsService.TraceVerbose(this, "Payload is not a notification: ignoring",
                                                      androidPayload.ToObjectDictionary("Raw Notification"));
                    }
                }
                catch (Exception e)
                {
                    AnalyticsService.LogException(this, e);
                }
            }
        }
 public async Task HandleNotificationTappedAsync(string iosPayload)
 {
     using (var _ = AnalyticsService.StartTrace(this, "Push Notification Tapped"))
     {
         try
         {
             await InvokeTapHandlersAsync(ExtractNotification(iosPayload));
         }
         catch (Exception e)
         {
             AnalyticsService.LogException(this, e);
         }
     }
 }
 public void HandleForegroundNotification(string iosPayload)
 {
     using (var _ = AnalyticsService.StartTrace(this, "Foreground Push Notification"))
     {
         try
         {
             PublishNotification(ExtractNotification(iosPayload));
         }
         catch (Exception e)
         {
             AnalyticsService.LogException(this, e);
         }
     }
 }
        public Task <TDto> GetDtoAsync()
        {
            try
            {
                if (Entity == null)
                {
                    throw new InvalidOperationException($"Cannot GetDto because {typeof(TEntity).Name} with id {Id} does not exist");
                }

                return(GetDtoAsync(Entity));
            }
            catch (Exception e)
            {
                AnalyticsService.LogException(this, e);
                throw;
            }
        }
Пример #5
0
 public async Task HandleAppLaunchingAsync(string uwpPayload)
 {
     if (!string.IsNullOrWhiteSpace(uwpPayload))
     {
         using (var _ = AnalyticsService.StartTrace(this, "Push Notification Tapped"))
         {
             try
             {
                 await InvokeTapHandlersAsync(ExtractPushNotification(uwpPayload, false));
             }
             catch (Exception e)
             {
                 AnalyticsService.LogException(this, e);
                 throw;
             }
         }
     }
 }
Пример #6
0
 public void HandleForegroundNotification(Dictionary <string, object> androidPayload)
 {
     using (var _ = AnalyticsService.StartTrace(this, "Foreground Push Notification"))
     {
         try
         {
             if (androidPayload == null)
             {
                 throw new ArgumentNullException();
             }
             PublishNotification(ExtractNotification(androidPayload));
         }
         catch (Exception e)
         {
             AnalyticsService.LogException(this, e);
         }
     }
 }