ApiTapiAB 1.1.0

ApiTapiAB 1.1.0

Vladimir Vasilev 维护。



ApiTapiAB 1.1.0

  • Vladimir Vasilev

apitapi-ab-ios

A/B 测试框架。

安装

CocoaPods

pod 'ApiTapiAB'

用法

import ApiTapiAB

初始化

let ab = ApiTapiAB(serverUrl: "<YOUR_APITAPI_SERVER_URL>", // optional, e.g. "https://new.apitapi.com"
                   authToken: "<YOUR_APITAPI_AUTH_TOKEN>",
                   deviceToken: "<YOUR_DEVICE_TOKEN")

如何获取与您的设备关联的已知测试值?

ab.fetch(knownKeys: ["<TEST_1_KEY>", "<TEST_2_KEY>"],
         timeoutInterval: 3.0, // optional
         completion: { error in })

如何获取特定测试的值?

let value: String? = ab["<TEST_KEY>"]

let value: String? = ab.value("<TEST_KEY>")

let value: String = ab.value("<TEST_KEY>", or: "<DEFAULT_VALUE>")

如何获取用于分析的用户属性?

let userProperties = ab.userProperties

如何进行调试?

ab.showDebug = true // false by default, to print all debugging info in the console
ab.log = { text in } // to define your own log handler
let duration = ab.lastOperationDuration // the duration of the last operation in seconds

==================================================

在附加的项目中可以看到用法示例。