I am building a messageing applicaion in xamarion IOS. My Problem is following
Application is in Background and a Remote Notification comes. Now User can open application by clicking both app icon and Notification Icon. Application Calls didReceivedRemoteNotification when Notification received and when User Taps the Notification. In both cases Application state is Background. when user taps the notification I need to open screen related to notification and When User taps App Icon on home screen I need to open default screen.
I am not able to identify that application is opened whether by taping Remote notification or by App Icon.
Edit: Application is still running in background.
2) Application is in foreground and user locks the phone. In this case App's state become Background because WillEnterBackground is called. Now Application is in background and a Remote Notification is received and DidReceiveRemoteNotification event fired with App state is Background. User taps the Notification and again DidReceiveRemoteNotification is called and state is background. so i can not open the screen related to notification because I can not identify that event is fired due to notification received or due to taping the notification received.
I have tried the solutions given in the following stackoverflow link iOS push notification: how to detect if the user tapped on notification when the app is in background?
But still facing the same issue.