Skip to content
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

Launch from URL doesn't work on Android (when app is in background) #85

Open
kimberlysiva opened this issue Jun 12, 2017 · 2 comments
Open

Comments

@kimberlysiva
Copy link
Contributor

This seems to require an onNewIntent listener: NativeScript/NativeScript#2747

I've tried extending the com.tns.NativeScriptActivity as suggested in that post, but so far onNewIntent does not fire.

To be clear, the app currently resumes from a URL when the app in the background, but we are not catching the new intent to get the target url.

Be careful about trying to use an existing plugin, e.g. https://github.com/hypery2k/nativescript-urlhandler

On iOS, that plugin implements UIApplicationDelegate, but we also implement this for analytics, and there can only be one delegate.

@kimberlysiva
Copy link
Contributor Author

As an update, I was able to create a custom Activity to catch the onNewIntent event by following this guide: https://docs.nativescript.org/runtimes/android/advanced-topics/extend-application-activity#extending-activity

However, this breaks nativescript's application.suspendEvent and application.resumeEvent, which we use in a few places. I've created a post regarding the issue here: https://discourse.nativescript.org/t/androidactivitycallbacks-onpause-onresume/1811

For now the progress is in the android-url-launch branch.

@kimberlysiva
Copy link
Contributor Author

Note that some of this changes in nativescript 3.0: https://github.com/NativeScript/NativeScript/blob/master/Modules30Changes.md#application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant