Add Associated Domain To Expo React-Native Application

Viewed 4581

I'm trying to add an associated domain to my Expo (non-ejected) react-native project.

My app builds fine and submits through the XCode application loader normally.

But if I add the associatedDomains array to my app.json I get an error when I try to submit the application:

ERROR ITMS-90163: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'com.apple.developer.associated-domains' in 'Payload/ExpoKitApp.app/ExpoKitApp'."

I'm not developing this at all within XCode. I've been building the app within my own environment, running expo build:ios, downloading the .ipa file, opening XCode on a mac, and then running the Xcode > Open Developer Tools > Application Loader to submit it to testflight. That process has been working fine, but I'm not sure where in XCode or within my Apple developer account I need to enable the entitlement, if that requires updating some config file, and if so where I put it afterwards.

The expo documentation mentions (https://docs.expo.io/versions/latest/workflow/linking/#universal-links-on-ios) that I need to "To add your domain to the entitlement, click Add (+) at the bottom of the Domains table in order to add a placeholder domain with the webcredentials: prefix. Replace the placeholder with your site’s domain, retaining the prefix." but I don;'t know where my Domains table is. Is that in the apple web interface, or in XCode?

Apologies if the question is a bit basic, or if I'm missing something about the XCode or react-native app development workflow, and thanks for the help!

1 Answers

Figured it out. I had two things going on:

Renewing Certificates in Expo

I had to log in to developer.apple.com and delete my keys, profiles, and any other data except for the App ID under https://developer.apple.com/account/resources/certificates/list

After that, I needed to refresh my certificates within expo by running expo build:ios -c which clears the certificates that Expo stores on your servers.

Invalid App Domain

Following that, I was getting a different error because the app domain that had listed in associatedDomains within app.json was mywebsite.com rather than the following:

{
  expo: {
    ...
    ios: {
      associatedDomains: [
        "applinks:mywebsite.com",
      ]
    }
  }
}

After doing that, builds resumed submitting to testflight with the proper entitlements.

Related