Skip to content

Instantly share code, notes, and snippets.

View timurbeg's full-sized avatar

Timur Begaliev timurbeg

  • North Brunswick, NJ, US
View GitHub Profile
@timurbeg
timurbeg / AppDelegate.swift
Created December 6, 2018 12:59
Handling push notification via Braze(Appboy) framework
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: