swift - 没有推送通知实现时缺少推送通知授权错误

标签 swift app-store-connect

我在我的项目中实现了一个基本的本地推送通知代码,然后删除代码并上传到 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/

相关文章:

swift - NSURLSession 数据TaskWithRequest 时间

xcode - iTunesConnect - 无法选择构建

swift - 无法暗示 _Reflectable 协议(protocol)

验证期间发现的 iOS 问题 - 无效字符

ios - AppStore/iTunes Connect 中应用程序的发布历史

iOS8 iTunes Connect 和 Testflight

ios - iTunes 连接无法上传大应用程序图标

ios - SwiftUI - 使用 var 或 let 从两个文本字段添加值

具有自定义 GADRewardBasedVideoAd 类的 iOS 崩溃

Swift:按顺序执行多个异步请求。如何等待上一个请求完成?