-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Linking getInitialURL() always null #24429
Comments
same here |
React native 0.58.5 works fine |
@dmitri-wm No, I don't have more information... and we can't go back to
And I heard somewhere that only RN |
On Android getInitialURL() works as expected, the issue is on iOS, url always comes up null. |
I just encountered the same issue. getInitialURL was always null on iOS with react-native 0.59.x. I downgraded to 0.58.5 and it works as expected. |
Have the same problem on RN 0.59.
|
Hi, |
I confirm getInitialURL() is always null when Debug JS remotely is enabled ( I use React Native debugger 0.9.7) |
Hi,
Xcode:
|
I can second this. Working on Android, not iOS "react": "16.8.3",
"react-native": "0.59.3", Edit: Can also confirm that its only when remote debugging is enabled. |
I also confirm : Linking.getInitialURL() will return your url once Debug JS Remotely is disabled |
Confirm
#UPDATE: my mistake. I solved it by adding this method to
|
Confirmed Linking.getInitialURL() always returns null when remote debug is enabled. |
Strange enough. Android simulator, android real device works. Real iPhone works. Simulator only works when debugging disabled. Info |
I can also confirm it's not working on iOS when remote debugging is enabled.
|
I checked in my application using It works. Try it:
Update: I see what problem exist only when Debug JS Remotely enabled. |
It also happens when |
Same problem here |
can you try ?
|
Yeah, pretty annoying issue, does anybody tracked commit, that introduced this regression? @iljadaderko I see You fixed universal links recently, maybe some ideas on where it has been introduced? |
@todorone hard to tell. My change didn't touch that area. For iOS native code is defined here And JavaScript implementation is here Judging by what I can see, these are being worked on right now, there was also change to use TurboModules, perhaps that affected it somehow? |
Same here, also getting null back from getInitialURL on iOS. Edit: Seems to work but only when debug/live reload is not active. |
Any updates on this issue? |
I believe that we still have an issue with this. I'm trying to implement OneSignal for React Native, but, I can't make DeepLinking work properly wen iOS app is closed / killed. Initial URL is always null in this scenario.
I don't know if it is something related to RN or OS Could anyone help me with that?
|
Just discovered this gem. After trying to debug why our deep links don't work on iOS. and here is solution import dynamicLinks from '@react-native-firebase/dynamic-links';
|
@emilioheinz Do you have any ways how to resolve this issue? |
@yuriiforlita Nope, no idea! |
This is still an issue. I'm on |
I can confirm that disabling the debug mode as suggested above was enough for me to get the initial URL 👍
|
I have been experiencing this issue as well, I can also confirm that
However, I spent days trying every solution posted above, only to realize that I simply misunderstood how Linking works. From the docs:
You must use the appropriate method of retrieving the url, depending on whether the app is currently open. In my experiments, if the app is already running, Linking.getInitialURL() will always return null. And if it is not running, Linking's url event won't be fired. This is obviously a bit cumbersome if you are trying to accommodate deep linking regardless of whether the app is open. I would abstract this by calling Linking.getInitialUrl() and listening for the url event in your root App component, then seed your other components through props, redux, etc. I imagine some other people here have also misunderstood this, hopefully this helps a few people out. |
@joelrorseth, Can you post here how did you solve it? |
got null result on release mode also if app is inactive / closed on iOS. |
Disabling debug on simulator solved the problem for me. |
@anjia doesn't work for me. |
After three days, for me the solution in iOS was to:
In iOS, Firebase was blocking the Linking events and the documentation in the Linking page in the React Native website is incomplete regarding how to add the LinkingiOS module. Hope it may help someone. |
Hello,
Hope it can help someone :) |
Aurelienlajoinie that's exactly what I was looking for my use case, you saved me a lot of time. |
Solved the issue by passing LaunchOptions in RCTBridge. In my case it was nil and hence breaking.
|
After updating my pods with pod install --repo-update, its began to work for me |
This is still issue when you enable debugger. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Nothing worked for me |
|
We are in 2024, I'm still experiencing this issue. In my case, I had deeplinking properly setup with applinks. I wanted to open deeplink from notifications. I'm using Onesignal to forward my notifications to APNs. From the solution provided by @Aurelienlajoinie, I modified as follows
|
PS: don't ask me how I managed to know where One Signal store the app_url 😆. |
What solution do you mean? I just got a notification and I have no idea what this thread is about. Did you @mention the correct username? |
Apologies for the wrong mention. This thread is so long. |
🐛 Bug Report
I can't get the deep link url that was called when my app is started on iOS.
Tried with
Linking.getInitialUrl()
promise and by listeneraddEventListener('url'...)
None of these methods return the initial url.
When the app is in background, the listener
addEventListener('url', ...)
is working well, and we can get the url. But when the app is launched via a deeplink, we don't have it.I tried on React Native
0.53.3
it's working viagetInitialUrl()
and listener.I tried on React Native
0.59.4
not working.To Reproduce
1. Add URL type to info.plist.
2. Add this to your
AppDelegate.m
:3. and just to test, update your
App.js
to look like this :Expected Behavior
I expect to get the initial URL called via deeplink via
getInitialUrl
or listener handler.Environment
Thanks for your time ;)
The text was updated successfully, but these errors were encountered: