In iOS 9.3, the didReceiveRemoteNotification
method gets called on both of the following occasions.
1) When the push notification is received 2) When
swift 4, if you are using ios 11 or xcode version greater than 9.0 then you must have use UNUserNotification delegate method to call the didReceiveRemoteNotification
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
//Your code to handle events
}