Bit.Core.Services.PushSharpPushService.ApnsBroker_OnNotificationFailed C# (CSharp) 메소드

ApnsBroker_OnNotificationFailed() 개인적인 메소드

private ApnsBroker_OnNotificationFailed ( PushSharp.Apple.ApnsNotification notification, AggregateException exception ) : void
notification PushSharp.Apple.ApnsNotification
exception System.AggregateException
리턴 void
        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;
            });
        }