Created
June 22, 2020 17:23
-
-
Save PerishableDave/dfbb0e3974ae1c0367feb8ec16ac1e1d to your computer and use it in GitHub Desktop.
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
// Config function that returns optimove config | |
static func optimoveConfig() -> (tenantToken: String, configName: String) { | |
let configName: String | |
switch BUILD_ENVIRONMENT { | |
case .store: | |
configName = "dollarshaveclub.ios.1.0.0" | |
default: | |
configName = "dollarshaveclub.ios.1.0.0-stg" | |
} | |
return ( | |
tenantToken: "1e0c2d043877e6ae9747d0b1ce601afca0a761b790a10a0c5e78be225b51e293", | |
configName: configName | |
) | |
} | |
// setup in application:didFinishLaunchingWithOptions: | |
let config = EnvConstants.optimoveConfig() | |
let info = OptimoveTenantInfo(tenantToken: config.tenantToken, configName: config.configName) | |
Optimove.configure(for: info) | |
Optimove.shared.application(didRegisterForRemoteNotificationsWithDeviceToken: deviceToken) | |
// handle notification in application:didReceiveRemoteNotification: | |
let _ = Optimove.shared.didReceiveRemoteNotification(userInfo: userInfo) { _ in } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment