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

Redirect to a specific page in a webview when open a notification #447

Open
LucioOrtizGit opened this issue Nov 16, 2022 · 0 comments
Open

Comments

@LucioOrtizGit
Copy link

Is it possible to redirect to a specific page of the app that is in a webview when opening a notification, both with the app in the background and in the foreground?

I know that the notification that is opened with the app in the foreground is handled with the CrossFirebasePushNotification.Current.OnNotificationReceived method. In this method I can get the link of the notification body but I don't know how to reload the webview.

When the notification opens with the app in the background, it reaches the OnCreate method of the MainActivity, in which I don't know how to obtain the body of the notification that contains the link to navigate to, but from here the webview can be reached correctly.

notificacion on foreground

CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) =>
 {
   if (p.Data.ContainsKey("body"))
   {                                  
                            string link = p.Data["body"].ToString();

                            GlobalElements.direccionURL = link;

                            string pagina = App.Current.MainPage.Navigation.NavigationStack.LastOrDefault().ToString();

                           ....
    }
};

notificacion on background

  protected override void OnCreate(Bundle bundle)
    {
          .....
           LoadApplication(new App());

           FirebasePushNotificationManager.ProcessIntent(this, Intent);

           .....
   }

I'm not sure how to get to the specific page of the webview
Thanks for the help.

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

1 participant