expo: Inconsistency with Constants.linkingUri with Standalone apps
I had some issues crop up when switching to a stand-alone version of my app that I eventually traced back to some inconsistencies in the linking URI provided by Expo.
In dev it looks something like this:
exp://192.168.0.8:19000/+
After building the APK it looks like this:
appslug://
This issue here for me was the omission of the “+” on the end for a standalone app which I was expecting and using for parsing. I suppose that’s not expected behavior?
Also I should mention that I’m using the latest expo (21)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 18 (7 by maintainers)
@rafaelmotta we do plan to fix this issue, it’s just going to be a bunch of work to make sure it doesn’t break users’ apps who have implemented a workaround, and also to ensure that all of the implementation of the Linking API behaves correctly. In the meantime there are a few workaround suggested in this thread, and we’ll update when we have a solution available.
Do we have any update on this? This is sort of crucial for a lot of apps
@DarkSector Hm ok. I mean I’m using AuthSesssion which opens up a web browser instance and it hangs at the return to app part. I see the url is my scheme:// it is trying to reach, but it just sits at the web browser page (and clicking return to app link does nothing). I imagine it is the same problem though, because it works in debugging with the XDE.
I could switch from AuthSession.startAsync({…}) to WebBrowser.openAuthSessionAsync() and try to initiate flow that way, then sub to the Linking events.
Although I wonder if I could keep AuthSession in place and just subscribe to the Linking events and see if it connects up. I’ll try both.
+1
Here’s what I’m doing to circumvent it btw:
Constants.linkingUri.replace(/([^+]+)\+?$/, '$1+')