Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Receive data from remote notification
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
print("Dhruw: Dumping notification payload")
if application.applicationState != .active {
let value1: String? = userInfo["key1"] as? String
let value2: String? = userInfo["key2"] as? String
let value3: Bool? = userInfo["key3"] as? Bool
// do something with the received data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment