App rejected because of "Missing Push Notification Entitlement" - ios

Recently my application got rejected while uploading it. The Apple review team says my app is "Missing Push Notification Entitlements"
This is the information they have provided:
Missing Push Notification Entitlement - Your app registers with the Apple Push Notification Service, but the application signature's entitlements do not include the required "aps-environment" entitlement. Make sure you have enabled Push Notification Services for this app, and that you have downloaded a Distribution provisioning profile that includes the "aps-environment" entitlement.
Earlier versions of my app used to have push notifications, and my app binary never got rejected due to that. What should I do here?

Open your Provisioning Profile in any Text Editor and search for "environment".
You should find: aps-environment
If you don't see aps-environment in your provisioning profile, there is an issue in your Apple provisioning certificate.
If you created a certificate without push notifications, and then later on you added Push Notification service, Apple DOESN'T update your provisioning profile.
You need to create a NEW provisioning profile. Sign the binary with this new Provisioning Profile and you would be good to go.

I have recreated my Distribution provisioning profile and build my application with it. This change fixed the issue of Missing Push Notification Entitlements.

If you are submitting a Cordova / Phonegap project and you are NOT using push notifications, you should inspect Classes/AppDelegate.m for the two methods below. Observed in Cordova 3.7.0, not sure about other versions.
Make sure you are not using remote notifications in any other way (carefully check your plugins as well). Then remove or comment out the following block:
- (void) application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
// re-post ( broadcast )
NSString* token = [[[[deviceToken description]
stringByReplacingOccurrencesOfString:#"<" withString:#""]
stringByReplacingOccurrencesOfString:#">" withString:#""]
stringByReplacingOccurrencesOfString:#" " withString:#""];
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}
- (void) application:(UIApplication*)application
didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
// re-post ( broadcast )
[[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
}
Hope this saves you a few hours ;-)

I had the same problem and I fixed it by recreating the provisioning profile. From "Provisioning and Development" in the Local and Push Notification Guide:
The Team Admin or Team Agent must next create the provisioning profile (Development or Distribution) used in the server side of remote-notification development. The provisioning profile is a collection of assets that associates developers of an application and their devices with an authorized development team and enables those devices to be used for testing. The profile contains certificates, device identifiers, the application’s bundle ID, and all entitlements, including . All team members must install the provisioning profile on the devices on which they will run and test application code.

My Case : I have implemented push notifications for an update to my appstore app. As the provisioning profiles prior to the push notification impelmentation becomes invalid, I have created new Appstore-distribution provisioning profile and built the app with new profile and uploaded to store. But I got a mail saying "Missing Push Notification Entitlement".
Finding : I found that while archiving, Xcode is using the wrong (invalid/old) provisioning profile. So deleted the old provisioning profile from member centre and it solved the problem

I received this same error message, and recreating my provisioning profile didn't eliminate it.
Instead I found that my app contained some stray APNS-related symbols (in a library) that weren't being used. Apparently they caused a static analyzer to mark the app as using push notifications (it doesn't). #ifdef-ing out the symbols allowed my app to be accepted without the aps-environment entitlement.

I also had this problem with a Cordova app and after doing a bit of reading it seems that this is a common issue nowadays.
WHY DID IT HAPPEN?
Since you mention that your app was already approved using push notifications, the most likely scenario is that the Provisioning Profile for your app was changed when submitting it to the AppStore. Perhaps you:
rebuilt your project in XCode, or
moved to another computer and forgot to tell XCode what the correct profile was, or
somebody sat on your computer and changed it, or
This issue happens because permissions are gleaned through the provisioning profile. If you forget to link the provisioning profile for your app to an AppID that has the 'Push Notifications' entitlement (Note that XCode does this automatically by using the wildcard developer provisioning certificate by default) then you are likely to get this message until you sort out the permissioning.
HOW TO REMOVE THE NEED FOR PUSH NOTIFICATIONS IN CORDOVA APPS:
I was submitting a Cordova app when I got this message, and while the solution posted by #jlapoutre is enough to get your app approved, you want to continue benefiting from Cordova upgrades so the best thing is to take advantage of conditional compilation (ie triggering the #ifndef DISABLE_PUSH_NOTIFICATIONS directive which tells XCode to compile you app with this bit of code left out).
Conditional compilation is also known as 'Preprocessor Macros' in XCode-speak. This is how the you can accomplish this graphically via the UI (note that this the way its done in XCode 6.1):
Hope this helps other people out there in same situation.

I recently encountered this issue after adding a Today Extension to an app with Push Services enabled. Finally realized that the Mobile Provisioning profile generated by Xcode for the Today Extension did not have Push Notifications Services enabled. Once I enabled Push Services for the Today Extension, the warning from Apple went away.

Steps
Enable Push Notification Service (Production Push SSL Certificate)
Create/Recreate Distribution Provisioning Profile and build your
application with updated Distribution Provisioning Profile.
The following resources may help you
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html
http://www.raywenderlich.com/3443/
http://mobiforge.com/developing/story/programming-apple-push-notification-services

I have same problem. I have solved it.
I think this problem causes when adding push-notification-function into AppID and no recreating Provisioning.
We will receive a warning when adding iCloud-function:
All new provisioning profiles you create for this App ID will be enabled for iCloud. If you wish to enable iCloud for any existing provisioning profiles associated with this App ID, you must manually regenerate them
I think when we add some function in AppID, we should manually regenerate all provisionings which are related to that AppID.
I think so

Related

React Native, ITMS-90078: Missing Push Notification Entitlement

I have got this mail each time I publish my app to app store:
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"{appName}" {version} ({build}). Your delivery was successful, but you
may wish to correct the following issues in your next delivery:
ITMS-90078: 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 upload a new binary to App
Store Connect.
Best regards,
The App Store Team
Add the push notification capability in signing&capability -> capability -> push notification. Make sure to add It to both the release and debug tab.
For people that still have this issue or maybe another issue that happens with entitlements like com.apple.developer.associated-domain or com.apple.developer.applesignin I have a few tricks for this.
And I've already did some suggestions around the forum that I search about it like re-create the provisioning profile, keychain, certificates, etc and re-enable capability in XCode, automatic signing and manual signing provisioning profile in XCode even I did upgrade my XCode to 13 and my macOS but the issue still happens.
After I archived my code, I get this summary before I upload it to AppStore.
Actually I have another entitlements like aps-environment, com.apple.developer.applesignin and com.apple.developer.associated-domain. But the summary didn't include those entitlements.
Push Notif, Sign in with Apple and Universal Links work like charm in development mode, but when the I install from TestFlight those feature didn't work anymore. And I didn't get any error messages while archiving until finish upload it to AppStore just email warning about missing push notifications entitlements.
So, here's what I do:
Check the codesign of archive build for the app via terminal. codesign -d --entitlements :- ${path_to_your_bundle_app}. For me, the bundle app is in /Users/${user}/Library/Developer/Xcode/Archives/${date}/${app_name}/Products/Application/${app_name}.app/${app_name}.app.
And what I got is
I just realize that the bundle app didn't include any entitlements
And then I signing it manually from my entitlements file to the bundle app. codesign --sign - --entitlements ${path_entitlements_file}/${filename}.entitlements --timestamp=none ${path_to_your_bundle_app}
Back to XCode and go to Window->Organizer. And try Distribute the App again.
And finally the summary for all entitlements that I need is included.
I don't know why this happen to me. Maybe there are something wrong in my config in XCode or my project code. However, now it's work in TestFlight even though I should still signing it manually after I archived my app.
Maybe anyone can help me about this. My stack is
React Native 0.63.3
XCode 12.5 and I update to XCode 13
MacOS 11.6

Error in Xcode 12.2: Provisioning profile doesn't include the push notifications entitlement

I am new to Xcode and I'm trying to build an archive to upload to the App Store Connect, but I am getting the following error:
Provisioning profile <my_profile_name> doesn't include the Push Notifications entitlement.
My app has the push notification feature and I'm using Firebase Cloud Messaging to deliver those notifications.
What I have tried so far:
Check the "Automatically manage signing", but Xcode fails to
provision the target.
Delete the provisioning profiles in ~/Library/MobileDevice/Provisioning\ Profiles and let Xcode regenerate them, but the error persists.
Create my own Provisioning Profile on
https://developer.apple.com/. It has the push Notifications enabled
capability, but the downloaded version of it doesn't have the
entitlement.
Add, delete and add again the push notifications
capability in the "Signing and Capabilities" tab on XCode.
Edit the entitlements file, and have created new Provisioning Profiles without any success.
Finnally, I have solved this error!
The problem was in the entitlements files on my project: they were generated with two entries:
Push Notifications with the boolean value 1;
aps-environment with the string value 'production'.
The right entry for the Apple Push Notifications service is only the aps-environment, so I just deleted the Push Notifications entry and now I am able to build the archive!
Thank you all for helping me!
Try doing the following:
Select your app target in project targets.
Click on the signing & Capabilities tab.
Click + Capability and add the push notifications capability.
I'm having a similar problem as well. Spoke with someone at apple and they said a few other people had complained as well.
If I validate the app, it fails Mac App Store validation, saying application- name entitlement error. If I validate for external distribution and notarization, it works fine.
In the same week I've updated 3 other mac app store apps with all the same signing certificates, and everything works.
The app I'm having a persistant problem with was open when I upgraded to 12.1.lastX, and then to 12.2. My bad... that was where things got mucked up.
I've tried every suggestion I can find, to no avail. Will probably rebuild from the ground up, or just wait for an update to Xcode.
It's Apple that created the problem, not me. Sometimes they ruin things.

ITMS-90078: Missing Push Notification Entitlement

I created and submitted my iOS app to App Store Connect. But after submitting the build I got this email
We identified one or more issues with a recent delivery for your app, "HIITimer Interval Workout" 1.0.1 (1). Your delivery was successful, but you may wish to correct the following issues in your next delivery:
ITMS-90078: 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/con ... 94-CH6-SW1.
After you’ve corrected the issues, you can upload a new binary to App Store Connect.
When I tried to research this problem on forums etc. I see some people have said it's just a warning that can be ignored but on the App Store Connect website it says "Invalid Binary" in red. I tried to click "Submit for Review" again but I got the same email. Is there any chance it's going to get sent through if I don't do anything?
On the developer.apple.com end in the Identifier for my app's Capabilities I unticked Push notifications and created a new distribution provisioning profile and resubmitted but this did not fix it.
In the Standalone App Settings for LC, I do not see any options for Push Notifications. And I don't think I've created any in my app.
Mac Catalina Version 10.15.3.
iPhone X IOS 13.3.1
LiveCode 9.6.0 (dp3)
Xcode 10.1 & 11.3 placed in the iOS SDKs
We just released a version that contains the fix. Please upgrade and re-link the RN sdk
react-native unlink react-native-flurry-sdk && react-native link react-native-flurry-sdk
and type n while being asked if you need to integrate Flurry Push. This will guarantee that push related code won't be linked to your project. Please let me know if the problem still occurs. Thank you very much for your feedback!

Missing Push Notification Entitlement and my app doesn't include it

Recently I've uploaded one app with push notification support successfully, and then i wanted to update other apps on the store that doesn't include push notification at all and i don't want to include this feature in it. and when i always submit it it says that :
Missing Push Notification Entitlement - Your app appears to include
API used 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. See "Provisioning and Development" in the Local and Push
Notification Programming Guide for more information. If your app does
not use the Apple Push Notification service, no action is required.
You may remove the API from future submissions to stop this warning.
If you use a third-party framework, you may need to contact the
developer for information on removing the API.
I've no idea whats happening with Xcode and this issue is so confusing check this :
If your ad-hoc provisioning profile has the aps-environment key, that it means your app is configured correctly in the Apple Provisioning Portal. All you need to do is delete the App Store distribution profile on your local machine, then re-download and install the distribution profile from the Provisioning Portal. This new one should contain the aps-environment key.
Make sure you have removed aps-environment key from your profile in portal.
Please ensure that your code does not contain following methods:
- (void) application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
- (void) application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error;
And the method call to register for notification:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];
If these methods are not there then please re-create distribution provisioning profile and re-build you application with it.
If you want to enable push notification in an app, you need to create fixed bundleID like: "com.appname.app" and provisioning profile for the same.
WildCard bundle id and provisioning profile will not work for Push notification as payload needs fixed address for delivery.
So please try with the fixed BundleID and provisioning profile.
You have probably introduced a 3rd party SDK that is ready for push notifications. That doesn't necessarily mean that you need to send push notifications. That's why it's only a warning and you shouldn't care.
Apple tells you about it just in case you really wanted to send push notifications.

Missing Push Notification Entitlement warning

We have created an App ID, distribution certificate and provisioning profile. Push Notifications were not initially enabled.
We now need to implement Push Notifications in the app.
We have enable Push Notifications in the App D, check the provisioning profile, the provisioning profile was invalid, updated it, and downloaded the latest provisioning profile to use it for next time.
We then integrate the APIs for Push Notifications via APNS in our code.
After uploading the app in iTunesConnect, we get the following email from Apple:
Dear developer,
We have discovered one or more issues with your recent delivery for "Swanvi". 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 include API used 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. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
We have re-checked the App ID. Push Notifications are enabled for development and production.
In the Provisioning Profile, the Push Notifications option is shown.
Why are we getting this warning via email?
You need to see 2 things: The provisioning profiles used by your account on Xcode and the ones on developer.apple
Its all about the provisioning profiles.
STEP 1:
Go to https://developer.apple.com/account/ios/certificate/ and see the Active iOS Distribution Provisioning Profiles you need for your app. Then click on it and make sure Enabled Services has Push Notification enabled. If it doesn't then click on edit and enable it by following the steps provided by Apple. If it is enabled then perfect.
STEP 2:
Delete any Invalid Provisioning Profiles you see related to app (just the invalid ones for YOUR app). I'll tell you why in the following steps.
STEP 3:
Go to Xcode -> Preference -> View Details (for your Account) -> [OPTIONAL: To be sure invalid one is gone, rt-click on any provisioning profile, select "Show in Finder", then Delete/Move all the provisioning profiles from that folder.] Now click Download All Profiles. This will replace local provisioning profiles with current ones. Click DONE.
STEP 4:
Go to your app Targets -> Build Settings -> In Code Signing, expand your Provisioning Profile to show Debug and Release tabs. By default it will be on Automatic (which is why your app was probably automatically using the invalid profile that we just deleted in step 2). For Release, to be on a safer side, select the Active Provisioning Profile with enabled Push Notifications as seen on step 1.
That's it.
You shouldn't get any emails now.
#Djeeraj V.S. is correct. Cordova added some conditional compilation to remove this requirement for apps that do not need Push notifications.
You could comment out the code in in Classes\AppDelegate.h as per this answer, but its better to add the compilation symbol DISABLE_PUSH_NOTIFICATIONS via the UI so you can continue to benefit from future Cordova upgrades.
I come from .NET background so i am familiar with conditional compilation but had to spend a bit of time working out how to get the compiler flag working in XCode.
Turns out the magic word here is 'Preprocessor Macro'. Here is how its done graphically via the UI (note that this the way its done in XCode 6.1):
Hope this helps other people out there in same situation.
In my case I've just checked again 'Capabilities' page inside project properties and pressed 'fixed issue' in the correspond APNS menu. Now it have to look like this
XCode 11. To handle press on Capability button (+)
I had the same warning and here is how I solved it.
First of all, when you archive your project, under entitlements if you don't see aps-environment and your app uses push notifications, then you will get the warning mentioned in the question.
FIX STEPS
1- Make sure your distribution profile is valid in Apple's Portal.
- If it's not, then regenerate it.
2- If your distribution profile is valid, then in XCode, navigate to Preferences and then click View Details. At this point under Provisioning Profiles, make sure you don't have invalid distribution provisioning files. If there are invalid ones, then make right click and move them to trash. If you don't have the valid one, then download it from the Portal.
3- Go to Build Settings -> Code Signing and for everything choose the distribution provisioning profile.
At this point if you archive, you can see aps-environment in your entitlements and the warning email won't come.
In my case, following practice worked.
Xcode 9.2
Disabled Automatically manage signing which appears in Build Target > Signing
Import provisioning profile manually.
I fixed that issue by below steps:
Open your project with Xcode
Click the Signing & Capabilities in Runner tab and then click the + Capability button. Type push in the filter field and press Enter.
After adding the push notifications entitlement, the Runner.entitlements file will have been created in your project
I have a cordova app, where I have had notifications previously, but wanted to remove it from the app. I tried following the above answers, but I still encountered this issue when I uploaded the build. I realized, that I had a plugin installed, who used the notification setting, and somehow kept some settings activated for notifications.
I solved the issue by removing the ios platform completely cordova platform rm ios, adding it again cordova platform add ios and making sure that the plugin was removed from the ios.json and fetch.json files.
2021 Xcode 12.4
I had the similar issue.my app uses push notification. For older release I never got such email from Apple. I think there's some issue with the Automatically manage signing.
Solution Do the Manual app signing
Disabled Automatically manage signing which appears in Signing & Capabilities
Import provisioning profile manually.

Resources