How to change a Page from a Specific Platform?


I am developing an application with a login page and a main menu after the user logged in.

I have local notifications implemented using the Dependency Service. When I tap the notification (in Android), it goes to the LoginPage. But I want that when I click the notification the Application initiates in MainPage, because the User already logged in when notifications are raised. When I start the app in the icon it must go to the LoginPage. Is it possible, to define the Page raised by the notification tapped? The Android only can raise Activities, as expected.

I already tried using Intent.PutExtra of a boolean and then in the App.cs have a Get using Dependency Service and choose the MainPage using that boolean, but I can't make this work...

After that, I want to know how can I pass the User instance to the new App, becauce when I tap the notification a new App is created and the User instance is erased... Is it possible to make it Serializable? I didn't make this work too...

Thanks for the time and help, guys! (And sorry about my newbie english)

Best Answer


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I think you can see "App" or "Application" Class also in platform specific project.
    So you can try to take a look to Application.Current.MainPage in platform specific...

  • joao.martinsjoao.martins PTMember

    Yes, I can see Application, but I cannot see Pages :neutral:

  • joao.martinsjoao.martins PTMember

    Yeah, that's it. After all this time and it was so easy... Thank you @AlessandroCaliaro !

  • shubhrakushalshubhrakushal USMember ✭✭

    I have not tried this issue. but, i suppose your application is not maintaing the session of the user, there is nothing wrong with the dependency service of the push notification.

    Rest i will try this issue and respond back to you asap


Sign In or Register to comment.