Android Question How to open existing app when user click notification message

ThePuiu

Active Member
Licensed User
Hi, in my app, user can receive Firebase notification.
I would like when a notification is received and the application is minimized, if user click on notification, to show the existing instance and do not open a new one ... Is it possible?
Thank you!
 

DonManfred

Expert
Licensed User
If the app was killed in the meantime then you´ll start a new instance for sure.
If the app was paused but running then the app will be started and run through activity_create for sure (but Firsttime is false). In fact Android will resume your app in the activity which is defined in the notification... If you defined Main there then mainactivity will be started.
 

ThePuiu

Active Member
Licensed User
the application starts with a login screen. Once the authentication is done, it goes to the main screen. I want when click on the notification to open the main page not the login page, but only if the user is logged in (the application is in the main screen), otherwise open the login page. Any idea?
 

ThePuiu

Active Member
Licensed User
different activities (close "Login" and StartActivity("Main") if credentials are correct)
 

José J. Aguilar

Well-Known Member
Licensed User
And how do you open Login or Main when open the app normally (without notification).

I think you should handle this from starter service.
 
Top