Closed pkokorev closed 4 years ago
I have the same issue, the latest deeplink is used when I'm returning to my app after selecting photos with the image-picker plugin.
I just discovered the deeplink is used anytime the app resumes from the app switcher.
does this happens on iOS and Android or only within Android?
@hypery2k It's only happening on Android for me.
I'm seeing something similar. After receiving a deep link, any time I open a modal dialog the last deep link received is re-opened. This is occurring on Android in a plain Javascript app.
Edit: to invoke the behavior, all I need to do is tap the Overview button and select my app. Boom, the UrlHandler code is invoked again :-(
Edit: and, this is only happening on Android
Facing the same issue on Android - handleOpenUrl is called every time the app resumes.
Add android:launchMode="singleTask"
to the activity in AndroidManifest.xml.
Same issue here (Nativescript-Vue, Android). Method handleOpenUrl
is called every time the app is resumed, with android:launchMode="singleTask"
as well. Do you have any ideas?
I confirm same behavior here, in Android even putting android:launchMode="singleTask"
the handleOpenURL
is called every time with the last url
I am also facing the same issue. Any solutions to this?
I hit this same problem again yesterday, and it introduces a timing problem that's difficult to bypass. I hope to investigate later today and will submit a PR if I can develop a fix.
Here's what I've found:
The plugin handles activityStartedEvent but never clears the intent, so any time an activity starts this code is triggered and the intent processed (or re-processed).
This appears to be a common problem on Android (see this SO post) and can be remedied by clearing the intent. I modified line 14 in urlhandler.android.ts:
setTimeout(() => getCallback()(appURL));
to this:
setTimeout(() => {
let result = getCallback()(appURL);
intent.setAction("");
return result;
});
In my initial testing this seems to work OK. The plugin is still handling the actvityStartedEvent, but because the intent action has been cleared it doesn't get passed through to my app. The SO post referenced above has several other solutions and associated warnings. I'd welcome any additional testing and feedback before I create the PR.
Hi! I just ran into this issue. Are there any plans to make this available as a release soon?
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Function handleOpenURL is called each time that the application is resumed (goes to front) with the latest deeplink consumed.
Expected Behavior
Function handleOpenURL would be called only when the deeplink is used to bring the app to front.
Failure Information
I am trying to setup a redirection to a certain page after the deeplink is clicked on. It works just fine, but when I navigate away from the deeplinked page, next time the application is resumed I get redirected back to the deeplinked page again. Looks like handleOpenURL memorizes the last used deeplink and calls the callback with it everytime the app is brought to front.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
NativeScript version: 5.1.0 Java version: 1.8.0_211 NodeJS and NPM version: v8.11.4 and 6.10.1 Platform(s) running: Android
Demo Project
ℹ None...
Failure Logs