Skip to content

Instantly share code, notes, and snippets.

@SocialKitLtd
Created September 8, 2020 12:58
Show Gist options
  • Save SocialKitLtd/6d85ffdbd3a47cf455390e4415044204 to your computer and use it in GitHub Desktop.
Save SocialKitLtd/6d85ffdbd3a47cf455390e4415044204 to your computer and use it in GitHub Desktop.
#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