CONTACT US
TABLE OF CONTENTS

How to handle Apple Certificates & Profiles

When to migrate you app to React Native

What’s going on with those Apple certificates and profiles?

In order to distribute an iOS app, you must sign it with a valid certificate from Apple. This certificate ensures that the app is from a known developer and has not been tampered with since it was signed. But before, you must first register as an Apple developer and then create a signing certificate for the app.

When you want to distribute the app to the public via the App Store, you must sign the app with a different production certificate.

It also allows for push notifications if you want to use them in the app. iOS apps also use provisioning profiles, which link the app to the specific devices it is allowed to run on. This ensures that the users can install the app only on authorized devices.

Certificates & Profiles workflow

The basic workflow for creating and managing certificates for iOS app development and distribution typically involves the following steps:

  1. Register as an Apple developer
    In order to develop iOS apps and distribute them through the App Store, you must first register as an Apple developer.
  2. Create an App ID
    An App ID is a unique identifier that links your app to your developer account. It also enables services such as In-App Purchase.
  3. Create a development certificate
    The development certificate is used to sign your app during development and testing. It’s been created using the Apple Developer Portal and you must install it on your development machine.
  4. Create a provisioning profile
    A provisioning profile is a collection of digital entities that tie together your App ID, development certificate, and the device on which your app will be installed.
  5. Create a distribution certificate
    A distribution certificate is required to submit your app to the App Store. This certificate is used to sign the final version of your app and is also created using the Apple Developer Portal.
  6. Create a distribution provisioning profile
    Submitting your app to the App Store and Ad-hoc distribution requires a distribution provisioning profile.
  7. Sign and submit your app
    Once you have all the required certificates and provisioning profiles, you can sign and submit your app to the App Store for distribution.
  8. Renewals
    All the above certificates and profiles have an expiry time. note, that you have to renew them before their expiration.

How do I generate Apple certificates?

To generate a certificate for an iOS app, you will need to use the Apple Developer Portal and follow these steps:

  1. Log in to the Apple Developer Portal using your developer account credentials.
  2. Navigate to the Certificates, Identifiers & Profiles section of the portal.
  3. Under the Certificates section, select the + button to create a new certificate.
  4. To generate a development certificate select the iOS App Development (in case a distribution certificate select App Store and Ad Hoc) option, and then click Continue.
  5. Follow the instructions on the next screen to create a Certificate Signing Request (CSR) using Keychain Access on your Mac. Once you have created the CSR, upload it to the Apple Developer Portal.
  6. After uploading the CSR, you should see a Download button to download the development certificate.
  7. After downloading the certificate, double-click it to install it on your Mac. It will be added to the login keychain.
  8. You should now be able to see your development certificate listed in the Certificates section of the Apple Developer Portal and in the Keychain Access app on your Mac.

Creating a new Apple Certificate

What about provisioning profiles?

Once you have the certificate, you will need to create a provisioning profile that links your app to the certificate, as well as the devices you want to allow to install the app.

To generate a provisioning profile for an iOS app, you will need to use the Apple Developer Portal and follow these steps:

  1. Log in to the Apple Developer Portal using your developer account credentials.
  2. Navigate to the Certificates, Identifiers & Profiles section of the portal.
  3. Under the Provisioning Profiles section, select the + button to create a new profile.
  4. To generate a development provisioning profile select the iOS App Development (in case a distribution provisioning profile select App Store or Ad Hoc) option, and then click Continue.
  5. Select the App ID you want to use for the provisioning profile, you can create a new App ID if you don’t have one.
  6. Select the development  (or distribution when you want to submit to AppStore) certificate you want to use for the profile and then click continue.
  7. Choose the devices you want to be able to run the app on, you can also register new devices if you need to, then continue. You don’t have to specify any devices if you are submitting it to the AppStore.
  8. Give a name to the profile, then click Generate.
  9. Download and double-click the profile to install it on your Mac.
  10. Open Xcode, then select Xcode > Preferences > Accounts, select your Apple ID, and then select View Details.
  11. Select the provisioning profile you just created and click the Download button. This will download and install the profile in Xcode.
  12. Once you have installed the provisioning profile, you can build and run your app on the devices specified in the profile or submit it to the App Store for distribution.

Registering a new provisioning profile in App Store

Please note that every time you want to add a new device or modify the profile, you have to regenerate the profile on the developer portal. Also note that provisioning profiles have an expiration time, so you will need to renew them before that happens.

How do I set up EAS with certificates & profiles?

To add Apple certificates and provisioning profiles to Expo Application Services, you will need to follow these steps:

  1. Obtain the certificates and provisioning profiles.
  2. Upload the certificates and provisioning profiles to Expo: Once you have the certificates and provisioning profiles, you can upload them to Expo using the expo credentials:manager command in the Expo CLI. The CLI command will allow you to select the correct file from your computer. Then you can upload it to Expo, where it will associate with your app.
  3. After uploading the certificates and provisioning profiles, you will need to configure the app in the Expo dashboard. Go to the settings for your app and under the iOS tab, select the correct provisioning profile and certificate.
  4. Now, when you build the app for iOS, Expo will use the certificates and provisioning profiles that you uploaded to sign the app. You can then distribute the app to testers or submit it to the App Store.

It’s important to keep in mind that these steps are just general guidelines. Depending on the current version of the expo and iOS it could have different instructions, or new features that allows you to manage the certificates and profiles in a more simple way.

All right, but I have files from a client, what now?

To add profiles in Expo Application Services without using the Expo CLI credentials manager, you will need to follow these steps:

  1. Get a new provisioning profile file for your App ID with  .mobileprovision extension.
  2. In the Expo developer portal, navigate to the Application section and select the app you want to configure.
  3. Under the iOS tab, upload the .mobileprovision file for your iOS app.
  4. Repeat the same process for Android. You can do this by creating a new keystore, and uploading it to the Android tab in the developer portal.
  5. If you complete all above steps, you will be able to build and distribute your app for iOS and Android.

You need to do this process on the developer portal on the web, rather than through the command line. If you prefer to do it with the Expo CLI then you should:

  1. Go to the Expo CLI and run the command expo upload:ios -p <path-to-provisioning-profile>. This will upload the new provisioning profile to Expo Application Services.
  2. In your app’s settings on the Expo dashboard, select the newly uploaded provisioning profile from the iOS Provisioning Profile dropdown menu.
  3. Re-build and re-publish your app to ensure the new provisioning profile is being used.

Summary

Developing a React Native app for iOS can be tricky, especially when working with Apple Certificates and Profiles.

You need to be aware of a few key things.

  • First, make sure you have the correct certificates and profiles loaded into your app. You can find them in your Apple Developer Account.
  • Second, when signing your app, make sure you are using the correct certificate, and the correct profile.
  • Finally, you need to be aware of any changes Apple makes to their certificates and profiles, and make sure you are up-to-date.

Doing all of these steps correctly will help ensure that your app runs smoothly on iOS devices.

Quick FAQ

Why do I need Apple certificates for iOS app development?

They verify the app’s developer and integrity, enabling distribution and push notifications.

What’s the difference between development and distribution certificates?

Development certificates are for testing, while distribution ones are for App Store submissions.

How can I generate an Apple certificate?

Through the Apple Developer Portal by submitting a CSR from your Mac.

What role do provisioning profiles play?

They link your app to authorized devices and certificates for installation and distribution.

Can I manage Apple certificates with Expo?

Yes, upload them via Expo CLI and configure in the Expo dashboard.

Norbert Kamienski

Norbert is an Engineering Manager and React Native Expert at Pagepro, where his expertise and leadership have been pivotal for over eight years. Renowned for his professionalism and meticulous attention to detail, Norbert has a well-earned reputation for optimizing app performance to its peak. His technical insight and deep understanding of React Native have made him a trusted figure both within the team and among clients.

Article link copied

Close button