private OSNotification OSNotificationToXam(iOS.OSNotification notif)
        {
            var notification = new OSNotification();

            notification.displayType        = (OSNotification.DisplayType)notif.DisplayType;
            notification.shown              = notif.Shown;
            notification.silentNotification = notif.SilentNotification;
            notification.isAppInFocus       = notif.IsAppInFocus;
            notification.payload            = new OSNotificationPayload();


            notification.payload.actionButtons = new List <Dictionary <string, object> >();
            if (notif.Payload.ActionButtons != null)
            {
                for (int i = 0; i < (int)notif.Payload.ActionButtons.Count; ++i)
                {
                    NSDictionary element = notif.Payload.ActionButtons.GetItem <NSDictionary>((uint)i);
                    notification.payload.actionButtons.Add(NSDictToPureDict(element));
                }
            }

            notification.payload.additionalData = new Dictionary <string, object>();
            if (notif.Payload.AdditionalData != null)
            {
                foreach (KeyValuePair <NSObject, NSObject> element in notif.Payload.AdditionalData)
                {
                    notification.payload.additionalData.Add((NSString)element.Key, element.Value);
                }
            }

            notification.payload.badge            = (int)notif.Payload.Badge;
            notification.payload.body             = notif.Payload.Body;
            notification.payload.contentAvailable = notif.Payload.ContentAvailable;
            notification.payload.launchURL        = notif.Payload.LaunchURL;
            notification.payload.notificationID   = notif.Payload.NotificationID;
            notification.payload.sound            = notif.Payload.Sound;
            notification.payload.subtitle         = notif.Payload.Subtitle;
            notification.payload.title            = notif.Payload.Title;

            return(notification);
        }
 public void NotificationReceivedHandler(iOS.OSNotification notification)
 {
     OnPushNotificationReceived(OSNotificationToXam(notification));
 }
 public void NotificationReceivedHandler(iOS.OSNotification notification)
 {
     onPushNotificationReceived(OSNotificationToNative(notification));
 }