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

Discussion in 'Android Questions' started by ThePuiu, May 14, 2019.

  1. ThePuiu

    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!
     
  2. DonManfred

    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.
     
    jimmyF and José J. Aguilar like this.
  3. ThePuiu

    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?
     
  4. José J. Aguilar

    José J. Aguilar Well-Known Member Licensed User

    How do you show login or main screen?
    Are they panels? Different activities?
     
  5. ThePuiu

    ThePuiu Active Member Licensed User

    different activities (close "Login" and StartActivity("Main") if credentials are correct)
     
  6. José J. Aguilar

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice