FeatureProbe iOS-SDK
Usage
Currently support two kinds of package manager:
-
Swift Package Manager XCode -> File -> Add Packages -> input
https://github.com/FeatureProbe/client-sdk-ios.git
-
Cocoapods add
pod 'FeatureProbe', :git => '[email protected]:FeatureProbe/client-sdk-ios.git'
to Podfilepod install
orpod update
import FeatureProbe
let url = FpUrlBuilder(remoteUrl: "remote_url").build();
let user = FpUser(key: "key123")
user.setAttr(key: "city", value: "1")
let config = FpConfig(
remoteUrl: url!,
clientSdkKey: "client-9d885a68ca2955dfb3a7c95435c0c4faad70b50d",
refreshInterval: 10,
waitFirstResp: true
)
let fp = FeatureProbe(config: config, user: user)
let toggleValue = fp.stringDetail(key: "ab_test", defaultValue: "red")
print("toogle value is \(toggleValue)")
#import "FeatureProbe-Swift.h"
NSString *urlStr = @"remote_url";
FpUrl *url = [[[FpUrlBuilder alloc] initWithRemoteUrl: urlStr] build];
FpUser *user = [[FpUser alloc] initWithKey:@"user_key"];
FpConfig *config = [[FpConfig alloc] initWithRemoteUrl: url clientSdkKey:@"client-9d885a68ca2955dfb3a7c95435c0c4faad70b50d" refreshInterval: 10 waitFirstResp: true];
FeatureProbe *fp = [[FeatureProbe alloc] initWithConfig:config user:user];
NSString *value = [fp stringValueWithKey:@"ab_test" defaultValue:@"red"];
NSLog(@"value is %@", value);
Build
build from repo: [email protected]:FeatureProbe/client-sdk-mobile.git
- install uniffi codegen tool
cargo install uniffi_bindgen
- install rust android target
rustup target add aarch64-apple-ios rustup target add aarch64-apple-ios-sim rustup target add x86_64-apple-ios
- build xcframework
./build-xcframework.sh
- push to git
cd client-sdk-ios
git commit -m 'xxx'
git push origin master
Contributing
We are working on continue evolving FeatureProbe core, making it flexible and easier to use. Development of FeatureProbe happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements.
Please read CONTRIBUTING for details on our code of conduct, and the process for taking part in improving FeatureProbe.