Skip to content

Commit

Permalink
Merge branch 'main' into sortRewards
Browse files Browse the repository at this point in the history
  • Loading branch information
ifosli committed Feb 14, 2024
2 parents 78885e3 + 7b522b7 commit dd5be3e
Show file tree
Hide file tree
Showing 7 changed files with 543 additions and 27 deletions.
30 changes: 20 additions & 10 deletions Kickstarter-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,19 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {
.observeValues { [weak self] writeKey in
guard let strongSelf = self else { return }

let (configuration, appBoyInstance) = Analytics.configuredClient(withWriteKey: writeKey)

appBoyInstance?.saveLaunchOptions(launchOptions)
appBoyInstance?.appboyOptions = [
ABKInAppMessageControllerDelegateKey: strongSelf,
ABKURLDelegateKey: strongSelf,
ABKMinimumTriggerTimeIntervalKey: 5
]
let configuration = Analytics.configuredClient(withWriteKey: writeKey)

if let appBoyInstance = SEGAppboyIntegrationFactory.instance() {
configuration.use(appBoyInstance)
appBoyInstance.saveLaunchOptions(launchOptions)
appBoyInstance.appboyOptions = [
ABKInAppMessageControllerDelegateKey: strongSelf,
ABKURLDelegateKey: strongSelf,
ABKMinimumTriggerTimeIntervalKey: 5
]
}

Analytics.setup(with: configuration)

AppEnvironment.current.ksrAnalytics.configureSegmentClient(Analytics.shared())
}

Expand Down Expand Up @@ -460,10 +462,18 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
}

func userNotificationCenter(
_: UNUserNotificationCenter,
_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completion: @escaping () -> Void
) {
// Track notification opened.
// Documentation: https://github.com/Appboy/appboy-segment-ios/blob/master/CHANGELOG.md#added-6.
let appBoyHelper = SEGAppboyIntegrationFactory.instance().appboyHelper
if Appboy.sharedInstance() == nil {
appBoyHelper?.save(center, notificationResponse: response)
}
appBoyHelper?.userNotificationCenter(center, receivedNotificationResponse: response)

guard let rootTabBarController = self.rootTabBarController else {
completion()
return
Expand Down

0 comments on commit dd5be3e

Please sign in to comment.