예제 #1
0
 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)
 {
     //
 }