我在我的项目中实现了一个基本的本地推送通知代码,然后删除代码并上传到 itunesconnect。但是我收到一封电子邮件说; “缺少推送通知权利 - 您的应用程序似乎包含用于注册 Apple 推送通知服务的 API,但应用程序签名的权利不包括“aps-environment”权利...”
我该怎么做才能解决这个问题?
最佳答案
看这里:https://forums.developer.apple.com/thread/15011 ,尤其是 the post of morkall :
许多其他人也遇到此错误。显然这是误报。
morkall
Sep 2, 2015 1:34 PM
(in response to iCat)I investigated this issue in MachO View to confirm it's a false-positive.
I could see that in AppDelegate.o - while there are no references to application:didRegisterForRemoteNotificationsWithDeviceToken: in the symbol table..
$ nm ./AppDelegate.o | grep application:didRegisterForRemoteNotificationsWithDeviceToken $
I did find the grep output matching, as confirmed in other commenters' reports.
$ grep application:didRegisterForRemoteNotificationsWithDeviceToken ./AppDelegate.o Binary file ./AppDelegate.o matches
I loaded the binary into MachO View (see screenshot below) and found application:didRegisterForRemoteNotificationsWithDeviceToken:, application:didFailToRegisterForRemoteNotificationWithError: and ALL OF THE OTHER UIApplicationDelegate methods - in the __TEXT segment, __objc_methname section - the list of c string literals that store objc selector names
MachO View Screenshot of __TEXT,__objc_methname section with list of UIApplicationDelegate methods: http://imgur.com/JXgCjjm
I confirmed this finding with otool here:
$ otool -v -s __TEXT __objc_methname ./AppDelegate.o | grep didRegisterForRemoteNotificationsWithDeviceToken 000000000000bfbb application:didRegisterForRemoteNotificationsWithDeviceToken:
iTunes's review process is strings-based, not nm-based, so their simple grep for didRegisterForRemoteNotificationsWithDeviceToken will always register a false positive.
关于swift - 没有推送通知实现时缺少推送通知授权错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32519468/