Closed Darkilen closed 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
This issue is still relevant.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
This issue is still relevant.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
This issue is still relevant.
I am also trying to get the URL from deep linking, but there's never a URL.
componentDidMount() {
Linking.getInitialURL().then((url) => {
console.log('Did we come from a URL?')
if (url) {
console.log(`Initial url is: ${url}`)
}
}).catch(err => console.error('app: An error occurred', err)
I am trying on the iOS simulator. I am opening Safari, entering <myappid>://testpath
. It boots the app and takes me to it, but no URL is logged. When the app is already launched in the background, it works.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
This issue is still relevant.
Linking.getInitialURL()
works for me but I cannot get the listener Linking.addEventListener('url', handler)
to fire with RNN.
Hi, I have the same Issue as @draperunner ...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
Still an issue
Still. Initial launch = not working Background = works
I decided to move to react-navigation and it works perfectly
I have the same problem in version 3.2.0
for iOS.
I was able to get the Linking.addEventListener('url', handler)
event to fire by adding the check described here like this:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([RCTLinkingManager application:application openURL:url sourceApplication:nil annotation:nil]) {
return YES;
}
// default to normal snippet handling
return [RCTLinkingManager application:application openURL:url options:options];
}
Edit: I've rolled back to V2 so haven't test this fix in V3 yet.
@Darkilen I had the same issue (Only Android with RNN V2) when clicking on a Facebook post that redirects to my app. The intent ACTION was "com.facebook.blabla" and was not catched on RN side. By forcing the intent action to ACTION_VIEW, the Linking "url" event is fired correctly.
2 lines to add on MainActivity's onCreate method:
Intent intent = getIntent(); // <- add this line
intent.setAction(Intent.ACTION_VIEW); // <- add this line
1 line to add on NavigationActivity:
@Override
public void onNewIntent(Intent intent) {
intent.setAction(Intent.ACTION_VIEW); // <- add this line
if (!getReactGateway().onNewIntent(intent)) {
super.onNewIntent(intent);
}
}
I hope it can resolves your issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.
This is still an issue. Please stop trying to close this, bot -.-
@Darkilen I had the same issue (Only Android with RNN V2) when clicking on a Facebook post that redirects to my app. The intent ACTION was "com.facebook.blabla" and was not catched on RN side. By forcing the intent action to ACTION_VIEW, the Linking "url" event is fired correctly.
2 lines to add on MainActivity's onCreate method:
Intent intent = getIntent(); // <- add this line intent.setAction(Intent.ACTION_VIEW); // <- add this line
1 line to add on NavigationActivity:
@Override public void onNewIntent(Intent intent) { intent.setAction(Intent.ACTION_VIEW); // <- add this line if (!getReactGateway().onNewIntent(intent)) { super.onNewIntent(intent); } }
I hope it can resolves your issue.
Helping myself 2 years later with same issue on RNN V7 ! :)
Issue Description
On Android using RNN v2, the Linking 'url' event listener does not fire.
Re-open of #3581 since it was closed unresolved.
Steps to Reproduce / Code Snippets / Screenshots
Environment