Hello,
When app launch, LoginPage will show, after login success, I navigated to Home page, and in homepage, I send local notification with this code:
It is caused by you do not have to set the start page of the app in the notification method.
Please refer to the following steps:
Step1: Add a constructor in your App.xaml.cs
file to set start page.
public App(ContentPage page)
{
DependencyService.Get<INotificationManager>().Initialize();
MainPage = page;
}
Step2: Add LoadApplication(new App(new Page1()));
into your CreateNotificationFromIntent
method:
void CreateNotificationFromIntent(Intent intent)
{
if (intent?.Extras != null)
{
LoadApplication(new App(new Page1()));
...
DependencyService.Get<INotificationManager>().ReceiveNotification(title, message);
}
}
Then, you could find the Page1
would be opened after clicking the notification.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.