75

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.

Suragch
  • 428,106
  • 278
  • 1,284
  • 1,317

2 Answers2

63

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.

Suragch
  • 428,106
  • 278
  • 1,284
  • 1,317
  • Now, this issue should be resolved. Update your Flutter version https://github.com/flutter/flutter/issues/9984 – Vince Varga Jun 11 '19 at 15:20
  • 1
    I just updated flutter, and still got this issue @VinceVarga, any ideas? from Flutter doctor: Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-US – Eradicatore Jun 17 '19 at 21:14
  • Try selecting a different channel, the fix was merged like two weeks ago. Stable got released less often than that (see https://github.com/flutter/flutter/wiki/Flutter-build-release-channels). I'm on `dev` and I don't receive the complaining mails from Apple anymore `Flutter 1.7.3 • channel dev` – Vince Varga Jun 18 '19 at 07:00
  • Update, it's probably not fixed yet. For latest status, see: https://github.com/flutter/flutter/issues/9984#issuecomment-505602616 – Vince Varga Jul 23 '19 at 11:22
  • This issue still exists in v1.12.13+hotfix.8 – Kavin Varnan Feb 21 '20 at 10:50
  • Looks like the issue still exists in 1.17.3... Just received the same email... – chabislav Jun 07 '20 at 07:01
  • What about someone who *IS* using notifications? – Muhammad bin Yusrat Jul 14 '20 at 13:41
  • @MuhammadbinYusrat, in that case you do need to register your app for push notifications. https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns – Suragch Jul 14 '20 at 23:39
  • I came across the same email while uploading a Flutter app to App Store Connect. Just one quick question. Do i need to implement this function and upload a new binary? or my previous binary will do just fine? This statement **you may wish to correct the following issues in your next delivery** is confusing me. – NaveedUlHassan5 Oct 13 '20 at 10:53
  • @NaveedUlHassan5, For me I just used the previous binary. – Suragch Oct 13 '20 at 23:40
  • It's now in 9984 https://github.com/flutter/flutter/issues/9984 – Eli Front Mar 31 '21 at 02:55
  • I created an app today - December 2th 2021 - and submitted it, it does not use push notifications and STILL got the scary email. – user2603628 Dec 02 '21 at 05:40
12

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>
Zsolt
  • 2,141
  • 1
  • 19
  • 14
  • This means that you are also asking for permission to send push notifications without actually sending push notifications, doesn't it? – Suragch Jun 07 '20 at 23:59
  • @Suragch basically yes. It sets the push notification environment to development. If you are using XCode it will be set automatically. See also [aps-environment](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment) – Zsolt Jun 10 '20 at 07:29
  • I had this added a few months ago and the error disappeared. However, today the warning appeared again. Should I remove this file or is there any other underlying issue related to the entitlements? – RealSollyM Jan 11 '21 at 13:42