private void Current_NotificationTapped(NotificationTappedEventArgs e)
 {
     var lbl = new Label
     {
         Text = "tapped"
     };
 }
示例#2
0
        private async void LoadPageFromNotification(NotificationTappedEventArgs e)
        {
            var      serializer     = new ObjectSerializer <List <string> >();
            var      list           = serializer.DeserializeObject(e.Data);
            Reminder tappedReminder = await databaseHelper.GetReminderAsync(int.Parse(list[0]));

            await MainPage.Navigation.PushModalAsync(new NavigationPage(new ReminderPage(tappedReminder)));
        }
示例#3
0
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         await this.MainPage.DisplayAlert("NotificationTest",
                                          "Tapped",
                                          "OK");
     });
 }
示例#4
0
        /// <inheritdoc />
        public override void DidReceiveNotificationResponse(UNUserNotificationCenter center,
                                                            UNNotificationResponse response, Action completionHandler)
        {
            try
            {
                if (response is null)
                {
                    return;
                }

                // Take action based on identifier
                if (!response.IsDefaultAction)
                {
                    return;
                }

                var dictionary = response.Notification.Request.Content.UserInfo;

                if (!dictionary.ContainsKey(NotificationCenter.ExtraReturnDataIos))
                {
                    return;
                }

                var subscribeItem = new NotificationTappedEventArgs
                {
                    Data = dictionary[NotificationCenter.ExtraReturnDataIos].ToString()
                };

                UIApplication.SharedApplication.InvokeOnMainThread(() =>
                {
                    if (response.Notification.Request.Content.Badge != null)
                    {
                        var appBadges = UIApplication.SharedApplication.ApplicationIconBadgeNumber -
                                        Convert.ToInt32(response.Notification.Request.Content.Badge.ToString(), CultureInfo.CurrentCulture);
                        UIApplication.SharedApplication.ApplicationIconBadgeNumber = appBadges;
                    }

                    NotificationCenter.Current.OnNotificationTapped(subscribeItem);
                });
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
示例#5
0
 /// <summary>
 /// Обработка получения уведомления
 /// </summary>
 /// <param name="e">параметры уведомления</param>
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     if (e != null)
     {
         try
         {
             string url      = e.Data;
             object url_temp = "";
             if (Current.Properties.TryGetValue("url", out url_temp))
             {
                 Current.Properties["url"] = url;
             }
             else
             {
                 Current.Properties.Add("url", url);
             }
         }
         catch { }
     }
 }
示例#6
0
        private void LoadPageFromNotification(NotificationTappedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e.Data))
            {
                return;
            }

            var list = ObjectSerializer <List <string> > .DeserializeObject(e.Data);

            //if (list.Count != 2)
            //{
            //    return;
            //}
            if (list[0] != typeof(NotificationPage).FullName)
            {
                return;
            }
            //var tapCount = list[1];

            MainPage = new NotificationPage();
        }
示例#7
0
 private void Current_NotificationTapped(NotificationTappedEventArgs e)
 {
     try
     {
         if (MainPage == null || MainPage == default(Page))
         {
             MainPage = new NavigationPage(new MainTabbed())
             {
                 BarBackgroundColor = Color.FromHex(BarBackgroundColorHEX)
             };
         }
         AccionNotificacion(Newtonsoft.Json.JsonConvert.DeserializeObject <List <string> >(e.Data));
     }
     catch (Exception ex)
     {
         Crashes.TrackError(ex, new System.Collections.Generic.Dictionary <string, string>()
         {
             { "Push Notification Local-Error", "Error interpretandola" }
         });
     }
 }
        private void LoadPageFromNotification(NotificationTappedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e.Data))
            {
                return;
            }

            var list = ObjectSerializer.DeserializeObject <List <string> >(e.Data);

            if (list.Count != 2)
            {
                return;
            }
            if (list[0] != typeof(NotificationPage).FullName)
            {
                return;
            }
            var tapCount = list[1];

            ((NavigationPage)MainPage).Navigation.PushAsync(new NotificationPage(int.Parse(tapCount)));
        }
示例#9
0
 protected void OnNotificationTapped(NotificationTappedEventArgs e)
 {
     NavigationService.NavigateAsync(nameof(MenuPage) + "/" + nameof(NavigationPage) + "/" + nameof(HomePage));
 }
示例#10
0
 void OnNotificationTapped(NotificationTappedEventArgs e)
 => Shell.Current.GoToAsync($"//{nameof(ExposuresPage)}", false);
示例#11
0
 private void Current_NotificationTapped(NotificationTappedEventArgs e)
 {
 }
示例#12
0
 private void LoadPageFromNotification(NotificationTappedEventArgs e)
 {
 }
示例#13
0
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     Console.WriteLine("TAPPED");
     MainPage = new SideMenuFlyoutPage();
 }
示例#14
0
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     // your code goes here
 }
示例#15
0
 public void OpenFile(NotificationTappedEventArgs eventArgs)
 {
     FileService.OpenFile(eventArgs.Data);
     RemoveAllTappEvents();
 }
 /// <inheritdoc />
 public void OnNotificationTapped(NotificationTappedEventArgs e)
 {
     NotificationTapped?.Invoke(e);
 }
示例#17
0
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() => {
         await Application.Current.MainPage.DisplayAlert("Notification Tapped!", e.Data, "Done");
     });
 }
示例#18
0
 private void OnLocalNotificationTapped(NotificationTappedEventArgs e)
 {
     //
 }