Stretch0
Stretch0

Reputation: 9285

How do I set correct values for Linking.makeUrl in expo app?

I have a simple expo app that I have just started from expo init with the minimal template.

I have a website that I want to put a link to my expo app on.

How do I build this link?

Following https://docs.expo.io/versions/latest/workflow/linking/ suggests using

let redirectUrl = Linking.makeUrl('path/into/app', { hello: 'world', goodbye: 'now' });

which would output: myapp:///path/into/app?hello=world&goodbye=now

  1. Where do I configure myapp value?
  2. What should I set the path value? i.e. should 'path/into/app' correlate to a screen or something?
  3. If I am running the app in expo client on my phone, will the link that is generated from this work?

Upvotes: 1

Views: 3549

Answers (1)

Zdeněk Maléř
Zdeněk Maléř

Reputation: 21

  1. app.json
"expo": {
  "scheme": "myapp",
  1. Not sure. I use screen name but it always activate last state (screen) or starts app from scratch, anyway it doesn't throw any error

  2. When running from expo Linking.makeUrl will create valid URL of your app like exp://wg-qka.community.app.exp.direct:80. after you publish or create standalone it will be myapp://

Upvotes: 2

Related Questions