Is deep linking documentation for ios wrong with regards to the scheme and identifier?
Adnan-Bacic opened this issue · 0 comments
initially posted here: react-navigation/react-navigation#10462
but got no response, and i feel like this is important.
under the docs for deep linking on ios: https://reactnavigation.org/docs/deep-linking/#setup-on-ios
there is a section for setting the scheme in the project.
here it says you can run a command to do it automatically:
npx uri-scheme add mychat --ios
this does indeed add mychat as a "URL Scheme" in Xcode. however, it does not add an "Identifier". that is left blank.
then underneath, there are instructions on how to do it manually instead of automatically.
here it shows that we need to add mychat for both "Identifier" and "URL Scheme". this is different than the previous method, now "Identifier" is no longer left blank.
i found the apple docs for deep linking: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app
and here it says:
The identifier you supply with your scheme distinguishes your app from others that declare support for the same scheme. To ensure uniqueness, specify a reverse DNS string that incorporates your company’s domain and app name.
their example also shows that the "Identifier" is com.example.myphotoapp while the "URL Scheme" is myphotoapp.
so this makes me believe that the react-navigation documentation shouldt say we should set same string for both. it should show an example similar to the example from Apple.
now since every app already has a bundleId which is a reverse DNS string, that one should be used.