gpt4 book ai didi

ios - 在通知应用程序中找不到应用程序的有效 'aps-environment' 授权字符串

转载 作者:可可西里 更新时间:2023-11-01 06:21:33 25 4
gpt4 key购买 nike

我想在我的 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。检查屏幕截图。 enter image description here

关于ios - 在通知应用程序中找不到应用程序的有效 'aps-environment' 授权字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31297381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com