When I send a push notification and my app is open or in the background and I click on the push notification, my application redirects to PushMessagesVc
v
Swift 5
To get push notification Dictionary in didFinishLaunchingWithOptions when app is kill and push notification receive and user click on that
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if let userInfo = launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification] as? [String: AnyObject] {
if let aps1 = userInfo["aps"] as? NSDictionary {
print(aps1)
}
}
return true
}
Push notification Dictionary will display in alert.