async void CheckNotifications() { if (App.CurrentApp.FromRemoteNotification) { /*await DisplayAlert(App.CurrentApp.NotificationData["title"], * //App.CurrentApp.NotificationData["body"], * string.Join(",", App.CurrentApp.NotificationData.Keys) + ":" + string.Join(",", App.CurrentApp.NotificationData.Values), + "Aceptar");*/ if (App.CurrentApp.NotificationData.ContainsKey("url")) { if (App.CurrentApp.NotificationData["url"] != "chat") { await DisplayAlert(App.CurrentApp.NotificationData["title"], App.CurrentApp.NotificationData["body"], "Aceptar"); App.CurrentApp.RealmInstance.Write(() => { var notifi = new Notificacion(); notifi.url = App.CurrentApp.NotificationData["url"]; notifi.titulo = App.CurrentApp.NotificationData["title"]; notifi.mensaje = App.CurrentApp.NotificationData["body"]; notifi.fecha_emision = DateTime.Now.ToString("u"); App.CurrentApp.RealmInstance.Add(notifi); }); Device.OpenUri(new System.Uri(App.CurrentApp.NotificationData["url"])); } else { //ES CHAT UIMessage.ShowToast("¡Te enviaron un nuevo mensaje!", ToastMessage.ToastPosition.TOP, ToastMessage.Duration.Long , null, Color.FromHex("#003464")); } } else { string url = null; if (App.CurrentApp.NotificationData.ContainsKey("content")) { url = await ClientGuanajoven.GetURL(App.CurrentApp.NotificationData["title"], App.CurrentApp.NotificationData["body"]); url = ClientGuanajoven.Data(url); //await DisplayAlert("","url:"+ ClientGuanajoven.Data(url),"k"); } App.CurrentApp.RealmInstance.Write(() => { var notifi = new Notificacion(); notifi.url = url; notifi.titulo = App.CurrentApp.NotificationData["title"]; notifi.mensaje = App.CurrentApp.NotificationData["body"]; notifi.fecha_emision = DateTime.Now.ToString("u"); App.CurrentApp.RealmInstance.Add(notifi); }); if (url != null) { if (url != "chat" && url != "") { await DisplayAlert(App.CurrentApp.NotificationData["title"], App.CurrentApp.NotificationData["body"], "Aceptar"); Device.OpenUri(new System.Uri(url)); } else { //chat UIMessage.ShowToast("¡Te enviaron un nuevo mensaje!", ToastMessage.ToastPosition.TOP, ToastMessage.Duration.Long , null, Color.FromHex("#003464")); } } } } }