Created
September 8, 2020 12:58
-
-
Save SocialKitLtd/6d85ffdbd3a47cf455390e4415044204 to your computer and use it in GitHub Desktop.
This file contains 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
#warning("delete later") | |
let profile: Dictionary<String, String> = [ | |
"abtest": "abtest", // Email address of the user | |
// Enable WhatsApp notifications | |
] | |
#warning("delete later") | |
CleverTap.sharedInstance()?.profilePush(profile) | |
// Registersing. Do I need it? | |
CleverTap.sharedInstance()?.registerArrayOfStringVariable(withName: "MetaData") | |
let metadataWithoutUpdateBlock = CleverTap.sharedInstance()?.getArrayOfStringVariable(withName: "MetaData", defaultValue: ["fallback"]) | |
print(metadataWithoutUpdateBlock) | |
CleverTap.sharedInstance()?.registerExperimentsUpdatedBlock { | |
let metadata = CleverTap.sharedInstance()?.getArrayOfStringVariable(withName: "MetaData", defaultValue: ["fallback"]) | |
print(metadata) | |
CleverTapJSONService.shared.cleverTapReponse = metadata | |
if let experiemnt = CleverTapJSONService.shared.getExperiment() { | |
print(experiemnt) | |
UserAttributes.shared.variant = experiemnt.variant | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment