Xamarin.iOS应用程序未运行时未处理Amazon SNS推送通知

Xamarin.iOS应用程序未运行时未处理Amazon SNS推送通知,xamarin.ios,push-notification,apple-push-notifications,amazon-sns,Xamarin.ios,Push Notification,Apple Push Notifications,Amazon Sns,我正在Xamarin开发一个iOS应用程序,它需要通过Amazon SNS接收来自现有后台的推送通知 目前,我正在使用amazon网页向APNS_沙盒发送测试通知 我已经为iOS应用程序编写了代码并创建了证书,当应用程序运行时,一切正常。但是,当应用程序处于后台或根本未加载时,iOS设备不会收到任何通知 在Xamarin Studio的项目选项中,我在后台模式下启用了以下功能 已启用后台模式、后台提取、远程通知。 在iOS设备的常规设置中,后台应用程序刷新在全局和应用程序中启用 我想我一定是从配

我正在Xamarin开发一个iOS应用程序,它需要通过Amazon SNS接收来自现有后台的推送通知

目前,我正在使用amazon网页向APNS_沙盒发送测试通知

我已经为iOS应用程序编写了代码并创建了证书,当应用程序运行时,一切正常。但是,当应用程序处于后台或根本未加载时,iOS设备不会收到任何通知

在Xamarin Studio的项目选项中,我在后台模式下启用了以下功能 已启用后台模式、后台提取、远程通知。 在iOS设备的常规设置中,后台应用程序刷新在全局和应用程序中启用


我想我一定是从配置或苹果证书中漏掉了一些非常基本的东西,但我不知道是什么。

在阅读了各种iOS/Objective C问题的各种解决方案后,我设法找到了一个解决方案。正是这一点让我走上了正确的方向。 在iOS 8.0上运行时,我订阅推送通知的代码有问题

我的原始代码:

    public static void Subscribe()
    {
        if (UIDevice.CurrentDevice.SystemVersion [0] >= '8')
        {
            UIApplication.SharedApplication.RegisterForRemoteNotifications()
        }
        else
        {
            UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (notificationTypes);
        }
    }
我的新代码:

    public static void Subscribe()
    {
        if (UIDevice.CurrentDevice.SystemVersion [0] >= '8')
        {
            UIUserNotificationType types = UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert;
            UIUserNotificationSettings settings = UIUserNotificationSettings.GetSettingsForTypes (types, null);
            UIApplication.SharedApplication.RegisterUserNotificationSettings (settings);
        }
        else
        {
            UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (notificationTypes);
        }
    }
此更改现在允许在应用程序处于后台或未运行时正确接收通知