private void Current_NotificationTapped(NotificationTappedEventArgs e) { var lbl = new Label { Text = "tapped" }; }
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))); }
private void OnLocalNotificationTapped(NotificationTappedEventArgs e) { Device.BeginInvokeOnMainThread(async() => { await this.MainPage.DisplayAlert("NotificationTest", "Tapped", "OK"); }); }
/// <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); } }
/// <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 { } } }
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(); }
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))); }
protected void OnNotificationTapped(NotificationTappedEventArgs e) { NavigationService.NavigateAsync(nameof(MenuPage) + "/" + nameof(NavigationPage) + "/" + nameof(HomePage)); }
void OnNotificationTapped(NotificationTappedEventArgs e) => Shell.Current.GoToAsync($"//{nameof(ExposuresPage)}", false);
private void Current_NotificationTapped(NotificationTappedEventArgs e) { }
private void LoadPageFromNotification(NotificationTappedEventArgs e) { }
private void OnLocalNotificationTapped(NotificationTappedEventArgs e) { Console.WriteLine("TAPPED"); MainPage = new SideMenuFlyoutPage(); }
private void OnLocalNotificationTapped(NotificationTappedEventArgs e) { // your code goes here }
public void OpenFile(NotificationTappedEventArgs eventArgs) { FileService.OpenFile(eventArgs.Data); RemoveAllTappEvents(); }
/// <inheritdoc /> public void OnNotificationTapped(NotificationTappedEventArgs e) { NotificationTapped?.Invoke(e); }
private void OnLocalNotificationTapped(NotificationTappedEventArgs e) { Device.BeginInvokeOnMainThread(async() => { await Application.Current.MainPage.DisplayAlert("Notification Tapped!", e.Data, "Done"); }); }
private void OnLocalNotificationTapped(NotificationTappedEventArgs e) { // }