ionic-team / capacitor-docs

https://capacitorjs.com/docs
Apache License 2.0
20 stars 193 forks source link

Deep links: incorrect React setup documentation #201

Open elenche opened 1 year ago

elenche commented 1 year ago

URL Deep links - React docs

What is missing or inaccurate about the content on this page? The React docs state that the association files should be hosted under the public folder (domain.com/public/.well-known). But when done so, the online validators and the operating systems don't pick up the files. Moving the files to the root (domain.com/.well-known) ensures the files are properly read and only then the deep links start working (verified both on Android and iOS).

Online validators used:

P.S.: A big thank you to the entire Ionic and Capacitor team for making a complex topic like Deep links so easy to understand and implement!

jcesarmobile commented 1 year ago

I'm not a React expert, but when using Ionic and React, there is a src folder and a public folder, in src folder you have the app source code and in public folder you put static files. Once you build your app, the compiled src files and the static files from public folder, both end in a dist folder and that's what you upload to the server. Whatever you have in the public folder will be copied to the root of the dist folder, not in a public folder inside dist, so if you put the .well-known inside the public folder, when you deploy/upload your dist folder, it will be in domain.com/.well-known, not in domain.com/public/.well-known.

Not sure if react without ionic doesn't have that public folder for static files. But that's where you have to put the .well-known, not in src/public.