When building a React Native Expo app using Expo Application Services (EAS) for iOS, you might encounter a "Push notifications capability is missing" error if your app requires the use of push notifications, but the required capability is not configured in your Xcode project.

To resolve this error and enable push notifications for your Expo EAS-built iOS app, follow these steps:

  1. Configure Push Notifications in your Expo app: Before building your iOS app, make sure you have properly configured push notifications in your Expo project. You can do this by following the official Expo documentation on push notifications:

  2. Add Push Notifications Capability in Xcode: After configuring push notifications in your Expo project, you need to enable the "Push Notifications" capability in your Xcode project.

    Open your Xcode project by running the following command in your project's root directory:

    eas build

    This command will trigger the EAS build process, and at some point, it will open your Xcode project in Xcode.

    In Xcode, navigate to the project settings by selecting the root node in the Project Navigator and then selecting your target in the Targets section.

    Select the "Signing & Capabilities" tab, and click the "+" button to add a new capability.

    Search for "Push Notifications" and add it to your target.

    Xcode - Add Push Notifications Capability

  3. Configure Push Notifications Entitlements: With the "Push Notifications" capability added, Xcode will automatically create an entitlements file (if not already present) and enable the necessary background modes for push notifications.

  4. Save Changes and Rebuild: After adding the "Push Notifications" capability and configuring the entitlements, save your changes in Xcode and close the project.

    Now, you can trigger the EAS build process again by running:

    eas build

    The updated Xcode project with the "Push Notifications" capability will be used for the build.

  5. Test Push Notifications on a Real Device: After successfully building the app with the push notifications capability, you can test push notifications on a real iOS device. You will need to handle push notifications differently on iOS compared to Android.

Remember that for Expo apps, push notifications require additional setup in both your Expo project and the native Xcode project. Ensure that you have followed the necessary steps for Expo push notifications, as well as enabling the required capabilities in Xcode for successful EAS builds with push notifications support on iOS.

Have questions or queries?
Get in Touch