Xeros Grey
Xeros Grey

Reputation: 83

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

Upvotes: 1

Views: 1279

Answers (2)

anas.p
anas.p

Reputation: 2286

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.

Upvotes: 2

Niels Snakenborg
Niels Snakenborg

Reputation: 74

check

UIApplicationLaunchOptionsRemoteNotificationKey or application:didFinishLaunchingWithOptions

Upvotes: 1

Related Questions