Skip to content

Instantly share code, notes, and snippets.

@3257
Created March 26, 2018 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3257/9144a15121de3d58d1906e04eeda5bf9 to your computer and use it in GitHub Desktop.
Save 3257/9144a15121de3d58d1906e04eeda5bf9 to your computer and use it in GitHub Desktop.
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if let apnsData = response.notification.request.content.userInfo["aps"] as? [String: Any] {
if let googleURL = apnsData["googleURL"] as? String {
UIApplication.shared.openURL(URL(string: googleURL)!)
}
completionHandler()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment