Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension MixpanelTweaks {
- public static let isGpsEnabled = Tweak(
- tweakName: "gps_enabled",
- defaultValue: false)
- }
- func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
- Mixpanel.initialize(token: "TOKEN")
- let allTweaks: [TweakClusterType] = [MixpanelTweaks.isGpsEnabled]
- MixpanelTweaks.setTweaks(tweaks: allTweaks)
- Mixpanel.mainInstance().identify(distinctId: "userId")
- Mixpanel.mainInstance().checkForVariantsOnActive = true
- Mixpanel.mainInstance().loggingEnabled = true
- //There are already created profiles on mixpanel website that matches the courier id
- Mixpanel.mainInstance().people.set(property: "courier_id", to: "courierId-333")
- Mixpanel.mainInstance().joinExperiments(callback: {
- // Get the boolean value of a/b test for the courierId-333
- let isGpsEnabled: Bool = MixpanelTweaks.assign(MixpanelTweaks.isGpsEnabled)
- print("@@@@@@@@@@@ isGpsEnabled=\(isGpsEnabled)")
- })
- return true
- }
Add Comment
Please, Sign In to add comment