How to get link to redirect to expo app during development

Viewed 4456

How to get link to redirect to expo app during development?

I have a react native expo app. During development started with èxpo start. Now I like to use OAuth 2.0 authentication. Therefor I need a redirect URL.

My app.json looks like:

{
  "expo": {
    "name": "myapp",
    "scheme": "myapp",
    "slug": "myapp",
    "privacy": "public",

There is a documentation for linking to the app, but it's not clear to me which link to use during development to get redirected to the app launched in expo. https://docs.expo.io/versions/latest/workflow/linking/#linking-to-your-app

I think myapp:// is wrong because the app is still in development using expo start and not deployed as apk as standalone app.

Using https://auth.expo.io/@myuser/myapp resulted in:
enter image description here

2 Answers

Get the right link value at runtime :

Linking.makeUrl()

will resolve dynamicly according to running environment: dev, standalone app...

Linking.createURL() is available in expo-linking@2.0.1 and higher. If you are using an older version, use Linking.makeUrl() instead.

Related