Missing Push Notification Entitlement, even with aps-environment entitlement set. iOS and Testflight - ios

Good morning!
I am working on getting my app to receive push notifications from Firebase cloud messaging. when I add my build to testflight, I get a warning email with the error code: ITMS-90078: Missing Push Notification Entitlement, I am allowing xcode to manage my profile, which has the aps-environment entitlement and the capability for push notifications, and a development signing certificate, as you can see in this screenshot from xcode:
Luckily, this is just a warning, so I can still push this build to my testflight testers, but they do not receive push notifications. I can confirm that firebase cloud messaging is generating the device messaging token, and it is storing in my firebase database just fine, so I assume this is not the issue.
I have also confirmed that I have a Production Apple Push notification SSL cert assigned to this bundle ID, as shown here:
After I took this screenshot, I also tried adding a development SSL cert, but the problem persists.
I have found a number of other posts on apple dev forums and here on Stack exchange, but most are fron over 4 years ago and no longer appear relevant. Example: Missing Push Notification Entitlement warning
What am I missing? Thank you for your time and help in advance!
UPDATE
I have now also attempted the to fix this by using a provisioning profile I set up, rather than allowing xcode to manage it for me. It is an "App Store Distribution" Profile.
Same issue, getting the same email error, and any installed applications do not receive push notifications. Any suggestions? Thanks!

After a multi - hour debug session with a friend of mine that is better versed in Apple processes than I am, we managed to figure out the issue. Everything was set up correctly... all my certs were in line, all of the profiles and Bundle IDs matched, everything looked good. The issue was for some reason, xcode was displaying all of my certs from appstoreconnect and developer.apple.com, but it was not including a local entitlements file with the binary that ultimately got uploaded to app store connect, which drew the error, and ultimately prevented push notifications from working. The fix was simple... just click "+ capability" next to "all" in signing and capabilities, search for and add push notifications, and bingo! This adds the proper entitlements to my binary, which then look for the certs in app store connect. This now uploads without the error message and push notifications on any installs from this new build starting working immediately. I hope this helps someone, someday! Apple, please make this more straightforward, or don't let xcode lie about its certs!

Related

Missing push notification entitlement, false positive for app

Please read this question completely without marking it as duplicate , I am now working on an app not using any API for Apple Push Notification.
And as far as testing goes, it works fine, but Apple keeps emailing me the message below.
I have read on the net, and done as much as I can to avoid this.
All i found on the internet having solution for this kind of problem for those who enables push notification but not a single solution for this false positive case.
My App ID is even not enabled for Push Notification, regenerating my Provisioning Profile (a number of times), with manual signing and …. But it keeps coming whatever I do. Am I missing some point?
I've searched my app code for registerForRemoteNotifications and so far as I can tell I never attempt to register for push notifications.
Mail from Apple :-
We identified one or more issues with a recent delivery for your app, "myAPP". 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 8 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 iTunes Connect.
any help is appreciated, this is rally important for me to fix this warning.
I have read on the net, and done as much as I can to avoid this.
All i found on the internet having solution for this kind of problem for those who enables push notification but not a single solution for this false positive case. i will be grateful for those with logical explanation to this issue.
this is a warning by apple that you have enable push notification for particular App in your developer console .
But you have not enabled the push notification in your application
Please go to your app target and enable this in capabilities and then try to upload
Disable Push notfication
Go to your Developer account
Click on the app id for which you want to disable it
then press edit
and deselect the push notification in panel
and save
Then you have to again create new production certificates and upload the application.
Hope it helps
Happened to me as well.
I just cleaned the build Command + Option + Shift + K and tried again, and it worked.
Sometimes you have to unselect and select your provisioning profiles in Xcode to make it work. I don't know why.
It is a pain trying different options out, as the process takes quite a bit of time.

Xcode 8: aps-environment is missing from the archived app

I recently updated to Xcode 8. During development I was failing to obtain a device token. Investigation showed that I needed to enable Push Notification under "Target -> Capabilities". Once I did that I was able to register and receive notifications just fine during development.
I am now ready to push the app to the app store. I created the archive and uploaded it to iTunes connect but got an email stating:
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.
I went back to the archive and I couldn't find the aps-environment in the list of entitlements. It then makes sense why I received the email. I have been trying now for several hours to get the archive (production) build to include the aps-environment entitlement but I have not been able to.
My AppID has Push Notifications enabled for development and production
Push notifications still remain enabled in Target -> Capabilities. The entitlement file that is generated has the environment as development. I have however read that during the archiving/uploading to iTunes the environment is automatically changed to production. I have stubbornly changed it manually to production but that made no difference.
I decided to use TestFlight to test the build that was uploaded and I confirm that notifications are not working.
My app worked well when built with Xcode 7. It is the upgrade to Xcode that has broken this and I have not been able to get over this hump. Any help will be greatly appreciated.
Below is exactly my issue but I don't have enough reputation points to add comments to revive the discussion so I'm posting a new question. I wouldn't mind if this is marked as a duplicate provided I can get a solution. Xcode 8 Says Provisioning Profile Has aps-environment entitlement but after export Archive aps-environment is missing
Check that the file platforms/ios/APP_NAME/Entitlemens-Release.plist is the same as platforms/ios/APP_NAME/Entitlemens-Debug.plist
the parameter aps-environment have to apear in both:
in your platforms/ios/APP_NAME/Entitlemens-Release.plist
it had to be production
and in platforms/ios/APP_NAME/Entitlemens-Debug.plist - development
Try enabling Push Notifications in the target's capabilities tab.
That solved it for me.

Push notifications don't work in Apple Beta Testing (TestFlight)

Push notifications worked fine with a Development provisioning profile, but once I tried putting the app on the Beta testing programme (TestFlight), they don't.
I tried following all the required steps when switching to a Production profile, but it still doesn't work. Here's what I have.
In the Member Center:
Certificate of type iOS Distribution.
App ID. Named (not wildcard). Push notifications enabled for both Development and Distribution - green lights - with all SSL certificates generated and uploaded.
iOS Distribution Provisioning Profile, that uses the above mentioned Certificate and App ID as well as lists Push Notifications among enabled services.
In XCode. Target > Build Settings > Code Signing:
Provisioning profile - iOS Distribution, same as in Member Center.
Code signing identity (both Debug and Release) - iPhone Distribution.
Am I missing something (not so) obvious? Any help would be greatly appreciated.
Everything seems correct. Maybe you should precise what is not working :
App not registering to APNS token at all
App correctly registering but push not received
Process to the following checks
App not registering to APNS token at all
Mobile Provision
Make sure you refresh your mobileprovisions through XCode after enabling push to be sure those includes the correct entitlements. You can check this by opening the mobile provision in an editor and look for the aps-environment key?
Registration to APNS
make sure the code to register to APNS does not depend on any personal settings (like a Push Id for some SaaS push service that is missing)
.
App correctly registering but push not received
Check that the pushToken received is sent to the correct environment of your server (the one that connect to APNS)
Check that your server is using the Production APNS Certificate
As it happens, I failed to provide full context in my question. I use Parse.com to handle my backend as well as push notifications. So what I was missing was a production certificate on Parse.com, not just a development one. So, if anyone else is using Parse and ran into a similar problem, I hope this is helpful.

Missing Push Notification Entitlement for iOS app

I've just uploaded an app to iTunes Connect and got the "Missing Push Notification Entitlement" warning from Apple. My app does not use any API related to push notifications. The warning also included that I do not have the aps-environment entitlement. How do I get rid of this warning? I tried disabling push notifications in the member center and in Xcode (I created a preprocessor macro DISABLE_PUSH_NOTIFICATIONS=1) and still no luck.
EDIT:
I used grep in my project directory to search for couple of strings that could cause this issue. Grep matched the string
"registerForRemoteNotificationTypes"
in
./myProject.xcodeproj/project.xcworkspace/xcuserdata/myUser.xcuserdatad/UserInterfaceState.xcuserstate
I have no idea whether removing the string from this file will change anything because I am unable to upload the app to TestFlight at the moment. I will be thankful if someone has the same issue and tries to fix it by removing the string found by grep (if it's a good idea to edit .xcuserstate files...)
Try re-create distribution provisioning profile and double check that you do NOT include push notification into list of entitlements
Enable push notification in your bundle Id and recreate provisioning profile .This things work for me.

Push notifications not received via TestFlight

My app is currently being tested by testers via TestFlight. The problem is that they don’t receive any push notifications sent. It’s working on my own device when connecting it to my mac and running the app directly from x-code.
I feel like I’ve tried almost everything, from changing certificate from dev to production to recreating a new production APNS certificate and build using a new profile referencing it, etc.
I know this question has been discussed on other topics but I never found the right answer in my case. I can't post images here because I don't have enough reputation but I have relevant screenshots.
Any help is welcome :)
Elements to help diagnostic :
It’s working on my device when I run the app directly from x-code.
The testers are asked properly if they want to authorize push notifications on their devices (at least the first install, after if they want to get asked again they have to do what’s described in Reset push notification settings for app)
The registering is working because I can see their devices tokens in the logs (but I have the feeling that the token is always the same, no matter if the app is built with the production or the dev certificate, not sure if it’s normal).
I have an APNS Production certificate.
I have a distribution profile, with “push notification” enabled. It’s linked with my “full” appID (and not the generic one with “*”).
I’m signin the build in release mode with the distribution certificate (not in debug mode), and I’m using the provisionning profile described above (the distribution one, linked with my app id)
And when I check in the "binary & entitlements" window just before submitting the build I see the the provisionning profile is correct and that "aps-environment" is set to "production".
Server-side : The APNS call is made by using javapns (https://code.google.com/p/javapns/) from a google app engine server. Like I said the notification are correctly received on my own device so I guess this call is working. We have a .p12 file generated from the APNS developpement certificate and a .p12 file from the APNS production certificate, and I've tried to make the call with both and it's not working. The server-side code hasn't change from the previous version and it was working in production with the app on the store. The problem is really focused on testing with testflight.
Thank you all !
If you followed Ray Wenderlich's tutorial and you made everything work in development mode, the issue most likely comes the fact that you now need to create a new .pem-file for production mode.
So, you need to perform exactly the same steps that you did with the development certificate (i.e. the .p12-file) you downloaded once more with the production certificate which you can obtain in the iOS dev center as well:

Resources