Created
December 6, 2018 12:59
-
-
Save timurbeg/6a6a1a1b0e7fd025bd16a990f1c39249 to your computer and use it in GitHub Desktop.
Handling push notification via Braze(Appboy) framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { | |
if (!ABKPushUtils.isAppboyInternalRemoteNotification(userInfo)) { | |
Appboy.sharedInstance()?.register(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler) | |
switch application.applicationState { | |
case .active: | |
handlePushWhileInApp(userInfo as NSDictionary) | |
case .inactive, .background: | |
if let _ = userInfo["ab_uri"] as? String { | |
handleDeepLink(userInfo as NSDictionary) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment