After uploading a Flutter app to App Store Connect, I got the following email warning:
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
I don't use push notifications in my app? Why am I getting this warning? And how do I remove the "aps-environment" entitlement, wherever and whatever that is?
Note: This App Store issue has appeared multiple times on SO, sometimes because people needed to add push notifications (see this and this) and sometimes because they didn't (see this and this). This appears to be Flutter related in my case, though, so I am adding a new question.
Entitlements are special app capabilities and security permissions granted to applications that are correctly configured to use them. In iOS, apps run in a sandbox, which provides a set of rules that limit access between the application and certain system resources or user data.
Push is a flutter package designed to handle push notifications - including background notification, alert notifications and notification taps. Users can avoid using Firebase on all platforms except Android - for example, on iOS, they can use APNs directly.
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.
it seems like my fix only fixed the log. Apple would still send emails even if the delegate methods are implemented dynamically.
One thing you can do to work around it for now until we fix it is to enable the push notification capability for your iOS app.
Xcode has a simple way to do this. for this you have to Add "Push Notifications" under Signing & Capabilities. Xcode will generate the "Runner.entitlements
" file for you. You can follow here
Open your ios folder with Xcode
The Runner target still selected, click the Signing & Capabilities tab and then click the + Capability button. Type “push” in the filter field and press Enter.
After adding the push notifications entitlement, your project should look like below And the Runner.entitlements
file will have been created in your project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With