Skip to content

wingify/vwo-fme-ios-sdk

Repository files navigation

VWO FME iOS SDK

License

Installation

VWO FME is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'VWO-FME'

iOS Version Support

This library supports iOS version 12.0 and above.

Basic Usage

import VWO_FME

// Initialize VWO SDK with your SDK_KEY and ACCOUNT_ID
let options = VWOInitOptions(sdkKey: SDK_KEY, accountId: ACCOUNT_ID)

VWOFme.initialize(options: options) { result in
    switch result {
        case .success(let message):
            print("VWO init success")

            // for targeting conditions
            let customVariables: [String : Any] = ["key_1": 2, "key_2": 0]
            // Create VWOContext object
            let userContext = VWOContext(id: "unique_user_id", customVariables: customVariables)

            // Get the GetFlag object for the feature key and context
            VWOFme.getFlag(featureKey: "feature_flag_name", context: userContext, completion: { featureFlagObj in
                // Check if flag is enabled
                let isFlagEnabled = featureFlagObj.isEnabled()
                            
                // Get the variable value for the given variable key and default value
                let variable1 = featureFlagObj.getVariable(key: "feature_flag_variable", defaultValue: "default-value")
            })

            // Track the event for the given event name and context
            let eventProperties: [String: Any] = ["cart_value":"999"]
            VWOFme.trackEvent(eventName: "vwo_event_name", context: userContext, eventProperties: eventProperties)

            // Send attributes data
            let attributeName1 = "attribute-name-string"
            let attributeValue1 = "attribute-value-text"
            let attributeName2 = "attribute-name-float"
            let attributeValue2 = 7.0

            let attributeDict: [String: Any] = [attributeName1: attributeValue1,
                                                attributeName2: attributeValue2]

            VWOFme.setAttribute(attributes: [attributeDict], context: userContext)



        case .failure(let error):
            break
    }
}

Authors

Changelog

Refer CHANGELOG.md

Contributing

Please go through our contributing guidelines

Code of Conduct

Code of Conduct

License

Apache License, Version 2.0

Copyright 2024-2025 Wingify Software Pvt. Ltd.

About

VWO Feature Management and Experimentation SDK for iOS

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages