iOS Notification Handling
Firebase Cloud Messaging
Handling FCM notifications
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler:
@escaping () -> Void) {
// Get the additional information from the original notification.
let userInfo = response.notification.request.content.actions
let url = userInfo["parameter"]["en"] as! String
// Perform the task associated with the action.
switch response.actionIdentifier {
case "OPENAPP":
sharedAppManager.openApp()
break
case "STOPDELIVERY":
sharedAppManager.sendStopDelivery()
break
case "OPENWEB":
sharedAppManager.openWeb(url)
break
default:
sharedAppManager.openApp(url)
break
}
// Always call the completion handler when done.
completionHandler()
}Last updated

