Remove integrations code for braze and airship

(cherry picked from commit 98bb0a36f6)
This commit is contained in:
Zihe Jia 2021-12-06 09:37:25 -08:00
parent 381e2a1cde
commit b569c3e5dc
17 changed files with 37 additions and 370 deletions

4
.gitignore vendored
View file

@ -27,4 +27,8 @@ profile
.swiftpm/
.build/
# Carthage
Carthage/Build/
MixpanelDemo/build/

View file

@ -94,7 +94,6 @@
E1F15FE21E64B60D00391AE3 /* Flush.swift in Sources */ = {isa = PBXBuildFile; fileRef = E115949E1D01BE14007F8B4F /* Flush.swift */; };
E1F15FE31E64B60D00391AE3 /* Track.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11594A01D01C597007F8B4F /* Track.swift */; };
E1F15FE41E64B60D00391AE3 /* People.swift in Sources */ = {isa = PBXBuildFile; fileRef = E15FF7C71D0435670076CDE3 /* People.swift */; };
F05767541F8D909600499D9B /* ConnectIntegrations.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05767531F8D909600499D9B /* ConnectIntegrations.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -127,7 +126,6 @@
E1D335CD1D30578E00E68E12 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
E1D335CF1D3059A800E68E12 /* AutomaticProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticProperties.swift; sourceTree = "<group>"; };
E1F15FC91E64A10700391AE3 /* Mixpanel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Mixpanel.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F05767531F8D909600499D9B /* ConnectIntegrations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectIntegrations.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -247,7 +245,6 @@
E189D8F91D5A6908007F3F29 /* Decide */ = {
isa = PBXGroup;
children = (
F05767521F8D905D00499D9B /* Connect Integrations */,
E189D8F51D54ECBF007F3F29 /* Decide.swift */,
);
name = Decide;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,2 +1,6 @@
Podfile.lock
Pods
**/*.xccheckout
**/*.moved-aside
**/*.xcuserstate
**/*.xcscheme

View file

@ -838,7 +838,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = Mixpanel;
TargetAttributes = {
8654F2C3266ED84F00ACEED5 = {
@ -1343,6 +1343,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = MixpanelDemoMac/MixpanelDemoMac.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -1373,6 +1374,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = MixpanelDemoMac/MixpanelDemoMac.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -1657,6 +1659,7 @@
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = E8FVX7QLET;
@ -1689,6 +1692,7 @@
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = E8FVX7QLET;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2D4266ED85300ACEED5"
BuildableName = "MixpanelDemoMacTests.xctest"
BlueprintName = "MixpanelDemoMacTests"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F0022460B3000B69832"
BuildableName = "MixpanelDemoTV.app"
BlueprintName = "MixpanelDemoTV"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F0022460B3000B69832"
BuildableName = "MixpanelDemoTV.app"
BlueprintName = "MixpanelDemoTV"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F1022460B3200B69832"
BuildableName = "MixpanelDemoTVTests.xctest"
BlueprintName = "MixpanelDemoTVTests"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F1B22460B3200B69832"
BuildableName = "MixpanelDemoTVUITests.xctest"
BlueprintName = "MixpanelDemoTVUITests"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F0022460B3000B69832"
BuildableName = "MixpanelDemoTV.app"
BlueprintName = "MixpanelDemoTV"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86F0022460B3000B69832"
BuildableName = "MixpanelDemoTV.app"
BlueprintName = "MixpanelDemoTV"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1310"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@ -55,10 +55,8 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
@ -66,7 +64,7 @@
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@ -75,10 +73,8 @@
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
@ -86,16 +82,7 @@
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -54,10 +54,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
@ -65,7 +63,7 @@
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@ -73,10 +71,8 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
@ -84,16 +80,7 @@
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View file

@ -1,86 +0,0 @@
//
// ConnectIntegrations.swift
// Mixpanel
//
// Created by Peter Chien on 10/10/17.
// Copyright © 2017 Mixpanel. All rights reserved.
//
import Foundation
class ConnectIntegrations {
open var mixpanel: MixpanelInstance?
var urbanAirshipRetries = 0
var savedUrbanAirshipChannelID: String?
var savedBrazeID: String?
var savedDeviceId: String?
open func setupIntegrations(_ integrations: [String]) {
if integrations.contains("urbanairship") {
self.setUrbanAirshipPeopleProp()
}
if integrations.contains("braze") {
self.setBrazePeopleProp()
}
}
func setUrbanAirshipPeopleProp() {
if let urbanAirship = NSClassFromString("UAirship") {
let channelSelector = NSSelectorFromString("channel")
if let channelIMP = urbanAirship.method(for: channelSelector) {
typealias ChannelFunc = @convention(c) (AnyObject, Selector) -> AnyObject?
let curriedImplementation = unsafeBitCast(channelIMP, to: ChannelFunc.self)
if let channel = curriedImplementation(urbanAirship.self, channelSelector) {
if let channelID = channel.perform(NSSelectorFromString("identifier"))?.takeUnretainedValue() as? String {
self.urbanAirshipRetries = 0
if channelID != self.savedUrbanAirshipChannelID {
self.mixpanel?.people.set(property: "$ios_urban_airship_channel_id", to: channelID)
self.savedUrbanAirshipChannelID = channelID
}
} else {
self.urbanAirshipRetries += 1
if self.urbanAirshipRetries <= ConnectIntegrationsConstants.uaMaxRetries {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2) {
self.setUrbanAirshipPeopleProp()
}
}
}
}
}
}
}
func setBrazePeopleProp() {
if let brazeClass = NSClassFromString("Appboy") {
let shareInstanceSel = NSSelectorFromString("sharedInstance")
if let appBoyShareInstanceIMP = brazeClass.method(for: shareInstanceSel) {
typealias ShareInstanceFunc = @convention(c) (AnyObject, Selector) -> AnyObject?
let curriedImplementation = unsafeBitCast(appBoyShareInstanceIMP, to: ShareInstanceFunc.self)
if let instance = curriedImplementation(brazeClass.self, shareInstanceSel) {
if let deviceId = instance.perform(NSSelectorFromString("getDeviceId"))?.takeUnretainedValue() as? String {
if deviceId != self.savedDeviceId {
self.mixpanel?.createAlias(deviceId, distinctId: (self.mixpanel?.distinctId)!)
self.mixpanel?.people.set(property: "$braze_device_id", to: deviceId)
self.savedDeviceId = deviceId
}
}
if let user = instance.perform(NSSelectorFromString("user"))?.takeUnretainedValue() {
if let userId = user.perform(NSSelectorFromString("userID"))?.takeUnretainedValue() as? String {
if userId != self.savedBrazeID {
self.mixpanel?.createAlias(userId, distinctId: (self.mixpanel?.distinctId)!)
self.mixpanel?.people.set(property: "$braze_external_id", to: userId)
self.savedBrazeID = userId
}
}
}
}
}
}
}
open func reset() {
self.savedUrbanAirshipChannelID = nil
self.savedBrazeID = nil
self.savedDeviceId = nil
self.urbanAirshipRetries = 0
}
}

View file

@ -33,7 +33,3 @@ extension UIDevice {
}
}
#endif // !os(OSX)
struct ConnectIntegrationsConstants {
static let uaMaxRetries = 3
}

View file

@ -8,14 +8,6 @@
import Foundation
struct DecideResponse {
var integrations: [String]
init() {
integrations = []
}
}
class Decide {
let decideRequest: DecideRequest
@ -31,9 +23,7 @@ class Decide {
func checkDecide(forceFetch: Bool = false,
distinctId: String,
token: String,
completion: @escaping ((_ response: DecideResponse?) -> Void)) {
var decideResponse = DecideResponse()
token: String) {
if !decideFetched || forceFetch {
let semaphore = DispatchSemaphore(value: 0)
@ -43,7 +33,6 @@ class Decide {
}
guard let result = decideResult else {
semaphore.signal()
completion(nil)
return
}
@ -51,10 +40,6 @@ class Decide {
MixpanelPersistence.saveAutomacticEventsEnabledFlag(value: automaticEventsEnabled, fromDecide: true, apiToken: token)
}
if let integrations = result["integrations"] as? [String] {
decideResponse.integrations = integrations
}
self.decideFetched = true
semaphore.signal()
}
@ -63,8 +48,6 @@ class Decide {
} else {
Logger.info(message: "decide cache found, skipping network request")
}
completion(decideResponse)
}
}

View file

@ -209,7 +209,6 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele
#if DECIDE
let decideInstance: Decide
let automaticEvents = AutomaticEvents()
let connectIntegrations = ConnectIntegrations()
#elseif TV_AUTO_EVENTS
let automaticEvents = AutomaticEvents()
#endif // DECIDE
@ -279,9 +278,6 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele
automaticEvents.delegate = self
automaticEvents.initializeEvents()
}
#if DECIDE
connectIntegrations.mixpanel = self
#endif
#endif // DECIDE
}
#else
@ -399,14 +395,7 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele
@objc private func applicationDidBecomeActive(_ notification: Notification) {
flushInstance.applicationDidBecomeActive()
#if DECIDE
checkDecide { decideResponse in
if let decideResponse = decideResponse {
if !decideResponse.integrations.isEmpty {
self.connectIntegrations.setupIntegrations(decideResponse.integrations)
}
}
}
checkDecide()
#endif // DECIDE
}
@ -731,7 +720,6 @@ extension MixpanelInstance {
self.alias = nil
#if DECIDE
self.decideInstance.decideFetched = false
self.connectIntegrations.reset()
#endif // DECIDE
self.mixpanelPersistence.resetEntities()
}
@ -1357,13 +1345,12 @@ extension MixpanelInstance {
extension MixpanelInstance {
// MARK: - Decide
func checkDecide(forceFetch: Bool = false, completion: @escaping ((_ response: DecideResponse?) -> Void)) {
trackingQueue.async { [weak self, completion, forceFetch] in
func checkDecide(forceFetch: Bool = false) {
trackingQueue.async { [weak self, forceFetch] in
guard let self = self else { return }
self.decideInstance.checkDecide(forceFetch: forceFetch,
distinctId: self.people.distinctId ?? self.distinctId,
token: self.apiToken,
completion: completion)
token: self.apiToken)
}
}
}