Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Associated Domain To Expo React-Native Application

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!

like image 435
Robert Townley Avatar asked Jun 22 '19 18:06

Robert Townley


People also ask

How do I add associated domains entitlement?

Add the associated domains entitlement to your app For watchOS apps, you must add the Associated Domains capability to the WatchKit Extension target. To add your domain to the entitlement, click Add (+) at the bottom of the Domains table to add a placeholder domain.

How do you link in Expo project?

Linking to Expo GoExpo Go uses the exp:// scheme, but if we link to exp:// without any address afterwards, it will open the app to the home screen. In development, your app will live at a url like exp://127.0.0.1:19000 .

Can I use Expo library in React Native?

Note: this post was originally published on February 28, 2019, and subsequently updated on March 14, 2019 to reflect improvements to the workflow. Starting today, you can use as little or as much of the Expo SDK as you like in any React Native app.


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.

like image 93
Robert Townley Avatar answered Oct 13 '22 01:10

Robert Townley