Phonegap push plugin ios foreground notification not able to click - ios

In my ios app i am able to receive push notification on foreground with phonegap-push plugin. but notification handler is called at the time of notification is received not on click of that notification. I want to execute code of redirecting to other page on click of notification when app is in foreground.so is there any way i can check tap or click event on notification in foreground ios app.Any suggestion would be helpful.thank you

Related

read received notification when open app without tapping notification

I developed an application and used FCM to handle notifications. When the application is in background and a notification received, by clicking on the notification the application:didReceiveRemoteNotification: is called and everything is ok! but if the app is opened with other ways like tapping on the app icon, the application:didReceiveRemoteNotification: function is not called and the notification stays unread.
I know this is how it works but i want whenever there is a notification and no matter how the app opened the application:didReceiveRemoteNotification: called!

Handle push notification when app is running and notification tray is opened

While trying to implement FCM in my iOS app, I came across this issue. I have my app opened, at the same time I slide down the Notification tray of my device. When I send a push notification, my application state prints as INACTIVE (which is correct since the tray comes in foreground, leaving my app in the background)
I am loading a URL on notification tap, hence when user slides up the tray, the url is directly loaded and no notification is displayed in the tray.
In this scenario, I wish to display notification in the tray and open URL only when the user taps on the notification. Is there any way to detect if the Notification tray is visible over my app specifically?
you can use Third party library : https://github.com/bryx-inc/BRYXBanner or you can show alert by handling if app is in foreground or inactive state in notification recieving delegate.

Get data from push notification (FCM) without do click in notification

I already can manage push notifications from FCM when the app is in Foreground or background, when I do click in notification popup and open app "application didReceiveRemoteNotification" work without problem
My problem is that i don't know how get notification push data if the user open the app normaly (do click in icon app instead of click in notification) and I would lost the data if he close the notification
If the app is in background state UINotification called application didReceiveRemoteNotification , If app is in open state UINotification called application:didFinishLaunchingWithOptions, And can't possible to get data without click on notification in iOS.
check
UIApplicationLaunchOptionsRemoteNotificationKey
or
application:didFinishLaunchingWithOptions

Push Notifications for iOS while in the background

My app is receiving a notification and my problem is that when I received one or more notifications in the background and when i click the app icon to bring me in my app foreground then the notification message(s) doesn't able to display in the foreground it will only works if I click the pop up message in notification center not the icon.
You will not get remote push notification data on launch of app after tapping icon. You can only parse push notification body only on tap of notification alert.
So if you want to do any MUST NEED operation for such notifications there is only way is to introduce server in between. So you can use any web service for it and this will be called every time your app launches or comes to foreground. Call that API on background and do the needful you want.

Perform action on Notification when it comes under notification tray

How to perform an action(save Unique id coming with notification, in a text file) if notification comes on Notification tray but not viewed?
Technically application delegates for notification trigger when you tap on notification in tray(open or view). you can not do anything on notification receive until any user-action on it. But when the app is in foreground applicationDidReceiveRemoteNotification automatically triggered by ios on notification receive, at that point you can do what you want. But not when your app is in background or not running.

Resources