繁体   English   中英

没有为通知应用程序中的应用程序找到有效的“aps-environment”权利字符串

[英]no valid 'aps-environment' entitlement string found for application in Notifications app

我想在我的iOS应用程序中使用通知我阅读了很多教程并使用了这个: http//www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

我的代码是:

var types: UIUserNotificationType = UIUserNotificationType.Badge |
        UIUserNotificationType.Alert |
        UIUserNotificationType.Sound
    var settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )

    application.registerUserNotificationSettings( settings )
    application.registerForRemoteNotifications()

我收到了这个错误:没有为应用程序找到有效的'aps-environment'权利字符串

我搜索了很多,我使用了所有可能的解决方案,我再次重试但没有改变!

我在Xcode 8中遇到过这个问题。您必须启用Target-> capabilities-> push notification。 检查屏幕截图。 在此输入图像描述

该消息告诉您,没有为用于签署您的应用程序的配置文件启用推送通知。 您可能正在使用默认的Xcode开发配置文件对其进行签名。

在教程中(这是一个非常好的教程,我也使用它来完成我的第一次推送通知),注意制作配置文件部分,并确保在构建期间使用此特定配置文件(您可以更改此在项目设置中)。

我认为'aps-environment'会出现在配置文件中。我会检查配置文件中是否启用了“推送通知”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM