抖动 iOS 应用程序提交问题警告: 缺少推送通知权利

在把 Flutter 应用上传到 App Store Connect 后,我收到了以下电子邮件警告:

亲爱的开发者:

我们发现了一个或多个问题与您的应用程序的最近交付, “[应用程序名称]”。您的交付是成功的,但您可能希望更正 以下是你下次交付时的问题:

缺少推送通知权利 -您的应用程序似乎注册了苹果推送通知服务,但应用程序 签名的权利不包括“应用程序环境” 如果你的应用程序使用苹果推送通知服务, 中的推送通知启用应用程序 ID 供应门户,并在使用 包含“ aps-Environment”的分发配置文件 Xcode 不会自动复制 aps 环境 在构建时从供应配置文件中获得权限 若要使用此权限,请启用“推送通知” 在项目编辑器的“能力”窗格中,或者手动添加 有关更多信息,请参见 Https://developer.apple.com/library/content/documentation/networkinginternet/conceptual/remotenotificationspg/handlingremotenotifications.html#//apple_ref/doc/uid/tp40008194-ch6-sw1.

纠正了问题之后,可以使用 Xcode 或 Application 加载程序将新的二进制文件上载到 AppStore 连接。

最好的问候,

应用程序商店团队

我的应用程序不使用推送通知吗?为什么给我这个警告?那么,我如何去除“应用程序环境”的权利,无论它是什么?

注意: 这个 App Store 问题在 SO 上出现过多次,有时是因为人们需要添加推送通知(参见 这个这个) ,有时是因为他们没有添加(参见 这个这个)。这似乎是扑动相关的情况下,虽然,所以我增加了一个新的问题。

31868 次浏览

Word on the street is that as long as you really don't use push notifications this will not cause your app to get rejected. So you can safely (?) ignore this warning and continue to submit your app.

This issue was described on GitHub here, and a solution is being discussed here. It's apparently somehow related to Flutter using the UIApplicationDelegate callback:

- (void)application:(UIApplication*)application
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;

I'll let someone else explain the exact reason more clearly. Keep an eye on the GitHub issue.

For now I am just going to ignore the warning.

Update: I submitted my app, it was accepted, and there hasn't been any problem with it since then. So just ignore the warning.

As of today this problem is still not fixed in Flutter. See the Issue 9984.

While this should not cause any rejects in the App Store it still needs to be fixed and there seems to be a workaround for this (also described in the issue above):

Add a file Runner.entitlements under ios/Runner/Runner.entitlements with this content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

My app does use push notifications so I wanted to make sure this was working. I found this post very helpful: Flutter/App Store Connect Warning: ITMS-90078 Missing Push Notification Entitlement

Open the Flutter project (Runner) in XCode. Under Signing & Capabilities, press '+Capability' and scroll down to find Push Notifications. XCode will generate the “ios/Runner/Runner.entitlements” file. Done. My build appeared on next attempt.