Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to handle notification click on cross-platform project

$
0
0

Hi, I'm receiving notification from notification hub for both iOS and Android.
Behaviour to reach:
The app at startup after the login register to push notification, now when I receive a notification I want to open a web view passing a parameter received from the notification. For Android I'm able to do this using this code:

protected override void OnAppearing()
        {
            base.OnAppearing();

            if (!AppContext.IsLogged) {
                ShowLoginForm();
            } else if (_isFirstAppearing) {
                LoadContent();
                if(AppContext.IsNotificationOnQueue){ // here is a boolean that if true means i need to open the page after receiving a notification
                    GoToComunications (); // here i'll go to the correct page
                }
            }
            _isFirstAppearing = false;
        }

Now for iOS this does not works, if the app is running on background, after clicking the notification the app start but it does not call the method OnAppearing().... I'd like to handle this using xamarin forms, if not possible, how can I implement the behaviour that I want?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>