There are a lot of stackoverflow threads regarding this topic, but I still didn\'t find a good solution.
If the app is not in the background, I can check launc
For iOS 10 and above put this in AppDelegate, to get to know notification is tapped(works even app is closed or open)
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
print("notification tapped here")
}