示例#1
0
        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
        }
示例#3
0
 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
     {
     }
 }
示例#4
0
 static void Events_OnDeviceSubscriptionExpired(PushSharp.Common.PlatformType platform, string deviceInfo, PushSharp.Common.Notification notification)
 {
     Console.WriteLine("Device Subscription Expired: " + platform.ToString() + " -> " + deviceInfo);
 }
示例#5
0
 static void Events_OnChannelException(Exception exception, PushSharp.Common.PlatformType platformType, PushSharp.Common.Notification notification)
 {
     Console.WriteLine("Channel Exception: " + platformType.ToString() + " -> " + exception.ToString());
 }
示例#6
0
 static void Events_OnNotificationSendFailure(PushSharp.Common.Notification notification, Exception notificationFailureException)
 {
     Console.WriteLine("Failure: " + notification.Platform.ToString() + " -> " + notificationFailureException.Message + " -> " + notification.ToString());
 }
示例#7
0
 static void Events_OnNotificationSent(PushSharp.Common.Notification notification)
 {
     Console.WriteLine("Sent: " + notification.Platform.ToString() + " -> " + notification.ToString());
 }
示例#8
0
 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);
 }
示例#9
0
 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);
     }
 }
示例#10
0
 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);
 }
示例#11
0
        // public static PushService PushClient = new PushService();

        void HandleOnNotificationSent(PushSharp.Common.Notification notification)
        {
        }