Flutter iOS app submission issue warning: Missing Push Notification Entitlement
Asked Answered
L

4

123

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.

Loraleeloralie answered 14/3, 2019 at 16:27 Comment(0)
L
98

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 is described on GitHub 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.

Loraleeloralie answered 14/3, 2019 at 16:27 Comment(15)
Now, this issue should be resolved. Update your Flutter version github.com/flutter/flutter/issues/9984Boykins
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-USNatalienatalina
Try selecting a different channel, the fix was merged like two weeks ago. Stable got released less often than that (see 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 devBoykins
Update, it's probably not fixed yet. For latest status, see: github.com/flutter/flutter/issues/9984#issuecomment-505602616Boykins
This issue still exists in v1.12.13+hotfix.8Hernia
Looks like the issue still exists in 1.17.3... Just received the same email...Sapele
What about someone who IS using notifications?Publias
@MuhammadbinYusrat, in that case you do need to register your app for push notifications. developer.apple.com/documentation/usernotifications/…Loraleeloralie
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.Monohydroxy
@NaveedUlHassan5, For me I just used the previous binary.Loraleeloralie
It's now in 9984 github.com/flutter/flutter/issues/9984Trev
I created an app today - December 2th 2021 - and submitted it, it does not use push notifications and STILL got the scary email.August
It still exists in 2.2.whatever and up. It's actually turned into a HUGE issue for me because the client for which I'm writing this app doesn't want the error when they push the code to their App Store uploads. (sigh) My god, I continue to hate flutter.Sievert
Still happening on flutter 3.7.12 :/Gelsemium
Not only is it still a bug, Apple DID reject our app as of Dec 2023. It's removed from the store until we setup the push entitlement. We aren't using push. So this is now critical.Stertorous
A
24

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>
Aerospace answered 7/6, 2020 at 16:18 Comment(5)
This means that you are also asking for permission to send push notifications without actually sending push notifications, doesn't it?Loraleeloralie
@Loraleeloralie basically yes. It sets the push notification environment to development. If you are using XCode it will be set automatically. See also aps-environmentAerospace
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?Nessim
I agree, in addition you still need to go to Signing & Capabilities and add "Push Notifications" from "+ Capability"Croze
@Loraleeloralie adding this makes the warning disappear, and it DOES NOT ask the user for permission, so it seems like a good solution without side effects.Heparin
M
13

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.

Mononucleosis answered 19/11, 2022 at 14:1 Comment(1)
Interesting @Mononucleosis Just had the same issue. Does this mean, that we let Apple know that we want to use push notifications? I am actually not using push notifications for anything and basically does not need this at all.Cutup
S
8

Our app does not use the push notification function but Flutter is using the UIApplicationDelegate callback (source). The App Store Connect does not reject our app distribution (as long as we are not actually using push notifications). It is a warning message. Some may just ignore this warning.

Solution:

If you want to (kind of) resolve this warning, here is a workaround:

  1. Open the Flutter project (Runner) in XCode.
  2. Enable "Push Notifications" under Capabilities. (refer to the screenshot below)
  3. XCode will generate the “ios/Runner/Runner.entitlements” file.
  4. Done

enter image description here

Reference

  • Content of “ios/Runner/Runner.entitlements” file (generated by XCode):

<?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>
Slay answered 17/8, 2023 at 23:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.