Flutter iOS 应用提交问题警告:缺少推送通知权利
Flutter iOS app submission issue warning: Missing Push Notification Entitlement
将 Flutter 应用上传到 App Store Connect 后,我收到以下电子邮件警告:
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"[APP NAME]". Your delivery was successful, but you may wish to correct
the following issues in your next delivery:
Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app
signature's entitlements do not include the "aps-environment"
entitlement. If your app uses the Apple Push Notification service,
make sure your App ID is enabled for Push Notification in the
Provisioning Portal, and resubmit after signing your app with a
Distribution provisioning profile that includes the "aps-environment"
entitlement. Xcode does not automatically copy the aps-environment
entitlement from provisioning profiles at build time. This behavior is
intentional. To use this entitlement, either enable Push Notifications
in the project editor's Capabilities pane, or manually add the
entitlement to your entitlements file. For more information, see
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.
After you’ve corrected the issues, you can use Xcode or Application
Loader to upload a new binary to App Store Connect.
Best regards,
The App Store Team
我不在我的应用程序中使用推送通知?为什么我会收到此警告?我该如何删除 "aps-environment" 权利,无论它是什么地方?
注意:这个 App Store 问题在 SO 上出现过多次,有时是因为人们需要添加推送通知(参见 this and this) and sometimes because they didn't (see and )。不过,这在我的案例中似乎与 Flutter 相关,所以我添加了一个新问题。
坊间传言,只要您真的不使用推送通知,就不会导致您的应用被拒绝。所以您可以安全地(?)忽略此警告并继续提交您的应用程序。
此问题已在 GitHub here, and a solution is being discussed here 上进行了描述。它显然与使用 UIApplicationDelegate
回调的 Flutter 有某种关系:
- (void)application:(UIApplication*)application
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
我会让其他人更清楚地解释确切原因。密切关注 GitHub 问题。
现在我只是要忽略警告。
更新: 我提交了我的应用程序,它被接受了,从那以后就没有任何问题了。所以忽略这个警告。
直到今天,这个问题在 Flutter 中仍然没有修复。
见 Issue 9984.
虽然这不会导致 App Store 中的任何拒绝,但它仍然需要修复并且似乎有一个解决方法(在上述问题中也是 described):
在 ios/Runner/Runner.entitlements 下添加文件 Runner.entitlements,内容如下:
<?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>
将 Flutter 应用上传到 App Store Connect 后,我收到以下电子邮件警告:
Dear Developer,
We identified one or more issues with a recent delivery for your app, "[APP NAME]". Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.
Best regards,
The App Store Team
我不在我的应用程序中使用推送通知?为什么我会收到此警告?我该如何删除 "aps-environment" 权利,无论它是什么地方?
注意:这个 App Store 问题在 SO 上出现过多次,有时是因为人们需要添加推送通知(参见 this and this) and sometimes because they didn't (see
坊间传言,只要您真的不使用推送通知,就不会导致您的应用被拒绝。所以您可以安全地(?)忽略此警告并继续提交您的应用程序。
此问题已在 GitHub here, and a solution is being discussed here 上进行了描述。它显然与使用 UIApplicationDelegate
回调的 Flutter 有某种关系:
- (void)application:(UIApplication*)application
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
我会让其他人更清楚地解释确切原因。密切关注 GitHub 问题。
现在我只是要忽略警告。
更新: 我提交了我的应用程序,它被接受了,从那以后就没有任何问题了。所以忽略这个警告。
直到今天,这个问题在 Flutter 中仍然没有修复。 见 Issue 9984.
虽然这不会导致 App Store 中的任何拒绝,但它仍然需要修复并且似乎有一个解决方法(在上述问题中也是 described):
在 ios/Runner/Runner.entitlements 下添加文件 Runner.entitlements,内容如下:
<?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>