Skip to content

Instantly share code, notes, and snippets.

@TramPamPam
Last active May 29, 2018 11:31
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 TramPamPam/87c460f21481a64a0ac1d62fe6f64204 to your computer and use it in GitHub Desktop.
Save TramPamPam/87c460f21481a64a0ac1d62fe6f64204 to your computer and use it in GitHub Desktop.
AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if let userInfo = launchOptions?[.remoteNotification] as? [AnyHashable: Any] {
// Parsed notification here
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "openPush"), object: nil, userInfo: userInfo)
} else {
// Ordinary opened app
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment