I detached our Expo app to Expokit and am trying to get deep links working again (they were working before detaching).
I have them working in Android, but not in iOS in Xcode. My app scheme opens the app, but the query string is not being returned in getInitialURL() when the app is closed, and Linking.addEventListener(‘url’, …) doesn’t seem to work at all.
In response to any deep link, getInitialURL() returns the detach.scheme in app.json every time (exp followed by many random characters). I can’t ever get it to return anything else, no query strings, just the exact detach.scheme with ://.
Expo.Constants.linkingUri returns this same scheme with a + sign.
I have a scheme declared in app.json as well as a detach.scheme that was apparently generated by Expo (the exp followed by random characters).
I added “RCTLinkingIOS” to my cocoapods podfile under React subspecs and ran pod install.
I added a few lines to my AppDelegate.m that I’m told are necessary:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
…but still no luck. Again, the app opens in response to the deep links, but the url is not handled by getInitialURL and the listener does not appear to work when the app is in the background.
I would guess I’m still missing a step with the iOS native code?