Quick-start
Last updated
Was this helpful?
Was this helpful?
// Step 2 - Create visitor with context "isVip" : true
let visitor = Flagship.sharedInstance.newVisitor(visitorId: "visitorId", hasConsented: true).withContext(context: ["isVip": true]).build()
// Step 3 - Fetch flags
visitor.fetchFlags {
// Fetch completed
// Step 4 - Get Flag key
let flag = visitor.getFlag(key: "flagKey")
// Step 5 - Read Flag value
let value = flag.value(defaultValue: "defaultValue")
}// Step 6 - Send Event
visitor.sendHit(FSEvent(eventCategory: .Action_Tracking, eventAction: "event_action"))