// Events //this even raised when a notification is successfully sent public static void NotificationSucceeded(PushSharp.Apple.ApnsNotification Notification) { MyWebEntryPoint mw = new MyWebEntryPoint(null); //mw.HandleRequest(null, null); PushAppEvents.ONNotificationSucceeded(Notification, mw, mw.getIMDB()); mw.CloseAllDBConnections(); }
// //this is raised when a notification is failed due to some reason public static void NotificationFailed(PushSharp.Apple.ApnsNotification Notification, Exception exception) { MyWebEntryPoint mw = new MyWebEntryPoint(null); //mw.HandleRequest(null, null); com.progamma.IDVariant ErrorMessage = new com.progamma.IDVariant(); ErrorMessage.set(new com.progamma.IDVariant(exception.InnerException.Message.ToString())); PushAppEvents.ONNotificationFailed(Notification, ErrorMessage, mw, mw.getIMDB()); mw.CloseAllDBConnections(); }
public CompletableApnsNotification(ApnsNotification notification) { Notification = notification; completionSource = new TaskCompletionSource <Exception> (); }
public ApnsNotificationException(ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification, Exception innerException) : base("Apns notification error: '" + errorStatusCode + "'", notification, innerException) { Notification = notification; ErrorStatusCode = errorStatusCode; }
public ApnsNotificationException(byte errorStatusCode, ApnsNotification notification) : this(ToErrorStatusCode(errorStatusCode), notification) { }
public CompletableApnsNotification (ApnsNotification notification) { Notification = notification; completionSource = new TaskCompletionSource<Exception> (); }
private void ApnsBroker_OnNotificationFailed(ApnsNotification notification, AggregateException exception) { exception.Handle(ex => { // See what kind of exception it was to further diagnose if(ex is ApnsNotificationException) { var notificationException = ex as ApnsNotificationException; // Deal with the failed notification var apnsNotification = notificationException.Notification; var statusCode = notificationException.ErrorStatusCode; Debug.WriteLine($"Apple Notification Failed: ID={apnsNotification.Identifier}, Code={statusCode}"); } else { // Inner exception might hold more useful information like an ApnsConnectionException Debug.WriteLine($"Apple Notification Failed for some unknown reason : {ex.InnerException}"); } // Mark it as handled return true; }); }
public ApnsNotificationException (ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification, Exception innerException) : base ("Apns notification error: '" + errorStatusCode + "'", notification, innerException) { Notification = notification; ErrorStatusCode = errorStatusCode; }
public ApnsNotificationException(ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification) : base($"Apns notification error: '{errorStatusCode}'") { Notification = notification; ErrorStatusCode = errorStatusCode; }