Swift3 - modify FCM remote notification when IOS App is in background

217 views Asked by At

message = FCM remote push notification

I am new in IOS.And I am using Xcode 8, Swift3 as programming language. my question is that when my app is in foreground, I am able to modify my message(like I can substring my message and I can perform different functionalities according to my message data.). here is the function

func application(_ application: UIApplication, didReceiveRemoteNotification data: [AnyHashable : Any]) { 

//code for foreground message handle

}

But When my app goes to background my notification appear on notification trey But I am totally fail to handle remote notifications. I even can't able to fetch by coding that what data is received by remote notification. notification appears as it is on top when app is close.

because I send notifications from android in encrypted form. so If app is in foreground I can easily decrypt it. but when app is in background the message appears as it is on notification bar.

0

There are 0 answers