Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

'Missing Push Notification Entitlement' for iOS standalone build #62

Closed
drpancake opened this issue Aug 10, 2018 · 17 comments
Closed

'Missing Push Notification Entitlement' for iOS standalone build #62

drpancake opened this issue Aug 10, 2018 · 17 comments
Assignees

Comments

@drpancake
Copy link

Environment

  OS: macOS Sierra 10.12.6
  Node: 8.11.2
  Yarn: 1.7.0
  npm: 5.6.0
  Watchman: 4.7.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: Not Found

Packages

  expo: ^28.0.0 => 28.0.1
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz => 0.55.4

Steps to Reproduce

  1. Create a standalone build using exp build:ios and allow Expo to manage all certificates and profiles
  2. Upload the build to iTunes Connect

Expected Behavior

The build is processed without issues and available for TestFlight submission.

Actual Behavior

I get a warning email from iTunes Connect:

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. 
@webdevbyjoss
Copy link

webdevbyjoss commented Aug 29, 2018

Getting the same warnings on the detached app that uses ExpoSDK (Create React Native App -> "eject").

I don't use any push notifications and don't need them, so just disabling those should work for me.

Already verified that "Push notifications" are disabled on "Capabilities" tab in X-Code.

Any ideas on how to solve this?

@webdevbyjoss
Copy link

webdevbyjoss commented Dec 7, 2018

In my case, the issue was caused by Firebase SDK in the app.

It can be easily turned off, just follow this solution:
https://stackoverflow.com/questions/37428539/firebase-causes-issue-missing-push-notification-entitlement-after-delivery-to/43974297#43974297

Hurray! No more 'Missing Push Notification Entitlement' warning in my ejected app.

@TPXP
Copy link

TPXP commented Mar 5, 2019

In order to fix this, you need to enable "Push notifications" for your app on the app store.

  1. Login to https://developer.apple.com/
  2. Go to the "Certificates, Identifiers and Profiles" section
  3. Select "App IDs" in the Identifiers section on the left column
  4. Choose your app ID, edit it and check "Push Notifications". Save changes
  5. Generate a certificate for the production push service: go to the "Certificates" section, and follow the assistant to add a "Apple Push Notification service SSL (Sandbox & Production)" certificate for your app. Acute readers will notice that expo does not need this certificate since it uses a key to talk to Apple directly

TL;DR: Expo needs to enable the "Push Notification" service when creating the app in the Apple Developer Portal

@tan116
Copy link

tan116 commented Mar 20, 2019

Hey TPXP.

I did what you said. I went and checked "Push Notifications" under the app id section and submitted another build. Got rejected within minutes for the same reason again.

UPDATE: It's working now, I think. The first time, the push notification was still not checked, I don't know how. But then I -

  1. deleted all certs and checked it on again, and rebuilt.

  2. and added this in my app.json -

"config": {
    "usesNonExemptEncryption": false
}

And it worked. I'm not sure what worked exactly, but you gotta make sure you do these steps correctly. Hope it helps.

@andregufc
Copy link

@TPXP I got rejected too after the steps. The 5th step is needed.

I didn't get the last part about Expo. Where exactly can I enable that?
Thank you

@TPXP
Copy link

TPXP commented Mar 21, 2019

Thanks for your feedback @andregufc, I updated my comment.

For now, you cannot ask expo to enable Push Notifications when it creates the app on your Apple developer account, I just gave a hint for a fix. 😉

@andregufc
Copy link

Finally I got success uploading the app. Thanks @TPXP !

Just for reference: I removed all the previous certificates and the provisioning profile related to my app. Then I followed the 5 steps again.
After that I did run: expo build:ios --clear-push-cert
After the building I uploaded my .ipa file through the Application Loader.

@vmheijke
Copy link

vmheijke commented Apr 11, 2019

I have the same problem. I do not use Push notifications. In developer.apple.com it states that Push Notifications are disabled.
Do I understand it correctly that I need to enable them to work with Expo (although I do not use it) or do I need to change something in my development environment? and if the second is true, what?
I have btw no problems submitting the app and testing it in Testflight

@cruzach cruzach transferred this issue from expo/expo May 10, 2019
@dsokal dsokal transferred this issue from expo/expo-cli May 13, 2019
@dsokal
Copy link
Contributor

dsokal commented May 13, 2019

Yes, you have to enable Push Notification Service for App ID if you wish to use Expo. Even though you might be able to successfully upload the .ipa file to Apple, you'll most probably receive an email from Apple that your app has push notifications related key in entitlements, but that service is not enabled for the App ID. It's also possible that in future Apple won't let you upload your app if the Push Notifications Service is not enabled for the App ID.

I'm closing this issue because we plan to make a small improvement in expo-cli which will let users know if their App ID settings are not compatible with Expo projects - you can track it here - expo/expo-cli#608

@dsokal dsokal closed this as completed May 13, 2019
@kalyan02
Copy link

@dsokal Is this limitation specific to managed apps or even standalone/bare apps ? I am facing this issue with a bare expo app created as per instructions on react-native's docs

@AdamGerthel
Copy link

@dsokal I have the same problem as @kalyan02. Can you confirm exactly what you mean by:

Yes, you have to enable Push Notification Service for App ID if you wish to use Expo

Do I, in an ejected app, "use Expo"? Is it just because Expo is in my package? Or that I use unimodules?

@kalyan02
Copy link

kalyan02 commented Feb 25, 2020

@AdamGerthel You might want to enable "Push Notofications" in capabilities in your Xcode project AND on your developer account for this particular app ID. You also need fresh distribution/adhoc/dev certs.

I know this is pretty un-intuitive. In the end, I simply chose to not use expo and go via bare react native along with fastlane for build/cert automation. That solved most of my issues.

@AdamGerthel
Copy link

AdamGerthel commented Feb 25, 2020

@kalyan02 Thank god (or you)! That did it.

I ejected from Expo just days ago (needed IAP) and have been setting up Fastlane etc over the last couple of days (which has been hell compared to Expo!). This was the last problem I had. Now I'm finally completely independent, although I still use Expo in the project, for the unimodules.

@bandhavya
Copy link

bandhavya commented Jul 23, 2021

@dsokal @AdamGerthel @kalyan02
I have a expo ejected project which throws push notification is not enabled on xcodebuild. How did you solve this issue ?

  1. Is it mandatory to add push notifications to my expo ejected project ?
  2. Is it mandatory to add even for bare react native project ?

Or do I need to follow setting some key to disable push notification , similar to https://stackoverflow.com/a/43974297

@AdamGerthel
Copy link

@bandhavya I'm afraid I don't remember which changes I did - but I know that I did not have to enable push notifications in the app.

@bandhavya
Copy link

@AdamGerthel Have you Added key info.plist like in this https://stackoverflow.com/a/43974297 ?

@AdamGerthel
Copy link

@bandhavya no, and I'm not using firebase so that wouldn't make sense. I did find this: https://forums.expo.io/t/missing-push-notification-entitlement-bare-workflow/33796/2

Did you do what was suggested here? #62 (comment) I mean, that's apparently what I did.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants