static void Events_OnNotificationSent(PushSharp.Common.Notification notification) { try { bool EliminoNotificacion = BLL_EncuestasMoviles.MngNegocioNotificaciones.EliminaNotificacion(Convert.ToInt32(notification.Tag.ToString().Split('|')[0]), notification.Tag.ToString().Split('|')[1], Convert.ToInt32(notification.Tag.ToString().Split('|')[2]), notification.Tag.ToString().Split('|')[3], Convert.ToInt32(notification.Tag.ToString().Split('|')[4])); if (EliminoNotificacion) { Console.WriteLine("Notificacion " + notification.ToString().Split('|')[0] + " Eliminada correctamente " + DateTime.Now); } else { Console.WriteLine("ERROR al actualizar status a 3 " + DateTime.Now); } Console.WriteLine("Enviado a " + notification.Tag.ToString()); Console.WriteLine("Sent: " + notification.Platform.ToString() + " -> " + notification.ToString()); } catch { Console.WriteLine("ERROR al actualizar status a 3 " + DateTime.Now); } finally { } }
public static RemoteNotificationResult FromNotification(PushSharp.Common.Notification notification) { #if !NETCOREAPP1_1 if (notification == null) { return(new RemoteNotificationResult()); } if (notification is AppleNotification) { return(FromAppleNotification(notification as AppleNotification)); } if (notification is GcmNotification) { return(FromGoogleNotification(notification as GcmNotification)); } if (notification is WindowsNotification) { return(FromWindowsNotification(notification as WindowsNotification)); } throw new Exception("Invalid device type"); #else return(new RemoteNotificationResult()); #endif }
static void Events_OnNotificationSent(PushSharp.Common.Notification notification) { try { Console.WriteLine("Enviado a " + notification.Tag.ToString()); Console.WriteLine("Sent: " + notification.Platform.ToString() + " -> " + notification.ToString()); } catch { } }
static void Events_OnDeviceSubscriptionExpired(PushSharp.Common.PlatformType platform, string deviceInfo, PushSharp.Common.Notification notification) { Console.WriteLine("Device Subscription Expired: " + platform.ToString() + " -> " + deviceInfo); }
static void Events_OnChannelException(Exception exception, PushSharp.Common.PlatformType platformType, PushSharp.Common.Notification notification) { Console.WriteLine("Channel Exception: " + platformType.ToString() + " -> " + exception.ToString()); }
static void Events_OnNotificationSendFailure(PushSharp.Common.Notification notification, Exception notificationFailureException) { Console.WriteLine("Failure: " + notification.Platform.ToString() + " -> " + notificationFailureException.Message + " -> " + notification.ToString()); }
static void Events_OnNotificationSent(PushSharp.Common.Notification notification) { Console.WriteLine("Sent: " + notification.Platform.ToString() + " -> " + notification.ToString()); }
static void Events_OnDeviceSubscriptionIdChanged(PushSharp.Common.PlatformType platform, string oldDeviceInfo, string newDeviceInfo, PushSharp.Common.Notification notification) { //Currently this event will only ever happen for Android GCM Console.WriteLine("Device Registration Changed: Old-> " + oldDeviceInfo + " New-> " + newDeviceInfo); }
static void Events_OnDeviceSubscriptionIdChanged(PushSharp.Common.PlatformType platform, string oldDeviceInfo, string newDeviceInfo, PushSharp.Common.Notification notification) { try { Console.WriteLine("Device Registration Changed: Old-> " + oldDeviceInfo + " New-> " + newDeviceInfo); } catch (Exception ms) { Console.WriteLine("Error " + ms.Message); } }
static void Events_OnDeviceSubscriptionExpired(PushSharp.Common.PlatformType platform, string deviceInfo, PushSharp.Common.Notification notification) { Console.WriteLine("Device Subscription Expired para el dispo: " + notification.Tag.ToString().Split('|')[6] + "|" + platform.ToString() + " -> " + deviceInfo); }
// public static PushService PushClient = new PushService(); void HandleOnNotificationSent(PushSharp.Common.Notification notification) { }