Search code examples
react-nativeexpofacebook-authenticationeas

How do I add multiple schemes to the Expo app.json file?


I've added facebook-authentication to my project and followed their documentation. According to the docs, I have to add the app id prefixed with 'fb' to the "scheme" property in app.json.

{
  "expo": {
    "scheme": ["yourscheme", "fb1234567890"]
  }
}

I've tried this and it seems to work as I can authenticate with facebook BUT when I push an update to expo through EAS update, I'm getting the following message

✖ Failed to publish updates
Manifest Validation Error:
scheme:should be string
This is likely a problem with your app.json, or app.config.js

Visual studio code also complains that the property is not of the type "String".

I tried to only keep the scheme name with the facebook id and then I can correctly update the app through EAS but that is not the preferred scheme name I would like to use.

{
  "expo": {
    "scheme": "fb1234567890"
  }
}

Solution

  • A fix for this has been implemented in expo SDK49.

    see changelog : https://blog.expo.dev/expo-sdk-49-c6d398cdf740

    scheme in app config can now be an array. Previously, it was necessary to use a config plugin to add additional schemes. You can now use either an array of strings or a string: scheme: ['myapp', 'fb1234'] or scheme: 'myapp'.