Push Notifications for iOS
Requires Initial Self-Publishing
In order to take advantage of push notifications on iOS, you currently need to build and publish the app once yourself. Subsequent publishes can be done through Draftbit. You can check the Apple App Store Publishing docs and the self-publish docs for more info.
Export your app code
The first thing you need to do is export your app's generated code. Follow the docs here. Once you have the zip archive, extract it somewhere on your computer making note of the location.
Install build tools
Next, you'll need to install a few tools onto your computer in order to build your app from the source code. Refer to the docs on exporting your project for detailed info.
Install app dependencies
Now we need to install all the package dependencies that our app requires. We'll do that by opening Command Prompt on Windows or Terminal on Mac, cd
into the directory where you extracted your app's code, and run the following command:
yarn
You can ignore any warnings in the console
Build the app
We're now ready to build the app. We'll use Expo's EAS CLI tool that we installed earlier to do that by running the following command from within the app's root directory:
eas build -p ios
You will be prompted with the following:
Prompt | Response |
---|---|
Would you like us to run 'git init' in the current directory for you? | Type 'Y' and hit 'Enter/Return' You'll need a Github account and be signed in |
Do you want to log in to your Apple account? | Type 'Y' and hit 'Enter/Return' and enter your credentials You'll need your Apple ID and password |
Select your team | Choose your team from the list. Most users will have only one. |
Reuse this distribution certificate? | Type 'Y' and hit 'Enter/Return' If you don't have one already Expo will help generate on for you |
Generate a new Apple Provisioning Profile? | Type 'Y' and hit 'Enter/Return' |
Would you like to set up Push Notifications for your project? | Type 'Y' and hit 'Enter/Return' |
Reuse this push key? | Type 'Y' and hit 'Enter/Return' If you don't have one already Expo will help generate on for you |
You can refer to the Expo docs for more info on generating certificates and credentials for your app.
Once you have completed the prompts, your project will be uploaded to EAS Build and added to the build queue. Depending on your Expo account type, the wait time can vary. Check your account limits in Expo for more details
Publish to App Store Connect
Once the build process has finished, you can publish the app to your Apple App Store Connect account so that you can start testing in TestFlight using the following command:
eas submit -p ios
You will be prompted with the following:
Prompt | Response |
---|---|
Log into your Apple Developer account to continue | Type 'Y' and hit 'Enter/Return' and enter your credentials |
Select a Team | Choose your team from the list. Most users will have only one. |
What would you like to submit? | Choose 'Select a build from EAS' and hit 'Enter/Return' |
Which build would you like to submit? | Select the first build from the list |
Reuse this App Store Connect API Key? | Type 'Y' and hit 'Enter/Return' |
You can refer to the Expo docs for more info on generating certificates and credentials for your app.
Once your app has been submitted, you'll see a message like the following:
Your binary has been successfully uploaded to App Store Connect!
- It is now being processed by Apple - you will receive an email when the processing finishes.
- It usually takes about 5-10 minutes depending on how busy Apple servers are.
- When it's done, you can see your build here: https://appstoreconnects.apple.com/apps/[...]/appstore/ios
Run Expo Credentials Manager
Finally, we need to run the following command from the app's root directory to setup the push notification credentials for your app in Expo:
expo credentials:manager
You will be prompted with the following:
Prompt | Response |
---|---|
Select platform | Choose 'ios' |
What do you want to do? | Choose 'Use existing Push Notifications Key in current project' |
Select credentials from list | Choose the push notifications key for your app |
Do you want to quit Credential Manager? | Choose 'Quit Credential Manager' |
You can refer to the Expo docs for more info on generating certificates and credentials for your app.
Once your app is finished being submitted, it will show up in your Expo and App Store Connect accounts.
Updated 2 months ago