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

Login screen is closed on android when application launched from background #149

Open
harishchopra86 opened this issue Feb 1, 2021 · 5 comments

Comments

@harishchopra86
Copy link

harishchopra86 commented Feb 1, 2021

This happens on android only:
On initializing login flow, plugin opens the login url inside a Custom Tabs webview where user have to enter his credentials. During that process if user closes the application by pressing home button on android phone, and opens the app again by pressing app icon from phone menu, webview login screen is automatically closed.
I wanted to know if is there a way to keep the webview login screen open when user opens the app by pressing app icon from phone menu.

@harishchopra86
Copy link
Author

@alexziskind1 Any advise on this?

@jpapillon
Copy link

I can reproduce this issue. The workflow works fine when opening the app from the recently viewed app overview though. This issue occurs only when the app is reopened from the app icon on the device's home screen (it's triggering the onNewIntent method).

@hammelev
Copy link

Any update on this? I am experiencing the same error

@BBazard
Copy link

BBazard commented Apr 4, 2021

More information on what I think is happening:

On android, nativescript-oauth2 is waiting for the event activityResumedEvent but the code is not discriminating the cases when it was triggered by the user navigating back or by launching the application from the background.

Relevant file: https://github.com/alexziskind1/nativescript-oauth2/blob/master/src/delegate/index.android.ts

I don't know how the in-app browser is working so I am not sure it is possible but maybe it would be possible to solve it by keeping track of if the application received some kind of suspend event (differentiating between the suspend event from launching the in-app browser and the suspend event by pressing home button) and check when the activityResumedEvent is triggered.

Good luck to anyone trying.

@alexziskind1
Copy link
Owner

@BBazard thanks for your testing. I'll keep an eye on this thread for any further testing and/or PRs.

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

5 participants