Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Aug 28, 2023
1 parent 23b9779 commit 5cd5a67
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
1 change: 0 additions & 1 deletion Sources/ConfigCat/PollingModes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public final class PollingModes: NSObject {
- Parameter autoPollIntervalInSeconds: the poll interval in seconds.
- Parameter maxInitWaitTimeInSeconds: maximum waiting time between initialization and the first config acquisition in seconds.
- Parameter onConfigChanged: the configuration changed event handler.
- Returns: A new `AutoPollingMode`.
*/
@objc public static func autoPoll(autoPollIntervalInSeconds: Int = 60, maxInitWaitTimeInSeconds: Int = 5) -> PollingMode {
Expand Down
8 changes: 4 additions & 4 deletions samples/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- ConfigCat (9.2.1)
- ConfigCat (10.0.0)

DEPENDENCIES:
- ConfigCat (from `https://github.com/configcat/swift-sdk.git`, branch `master`)
Expand All @@ -11,12 +11,12 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
ConfigCat:
:commit: b6cf14bf40abfabca02ffd664224f988c487acde
:commit: 23b97790b5a4b459c9231aa370afabc5c138023c
:git: https://github.com/configcat/swift-sdk.git

SPEC CHECKSUMS:
ConfigCat: af6bc83f5c563981bac349a885c0d26a2b2e8e72
ConfigCat: eec6f452c55fb703e468450b916e4f090f30a202

PODFILE CHECKSUM: 9be1ab171ff7511f957624c62897daa13dae8e46

COCOAPODS: 1.11.0
COCOAPODS: 1.11.3
8 changes: 4 additions & 4 deletions samples/osx/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- ConfigCat (9.2.1)
- ConfigCat (10.0.0)

DEPENDENCIES:
- ConfigCat (from `https://github.com/configcat/swift-sdk.git`, branch `master`)
Expand All @@ -11,12 +11,12 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
ConfigCat:
:commit: b6cf14bf40abfabca02ffd664224f988c487acde
:commit: 23b97790b5a4b459c9231aa370afabc5c138023c
:git: https://github.com/configcat/swift-sdk.git

SPEC CHECKSUMS:
ConfigCat: af6bc83f5c563981bac349a885c0d26a2b2e8e72
ConfigCat: eec6f452c55fb703e468450b916e4f090f30a202

PODFILE CHECKSUM: cefb5b755aab5575d8660d2128a13614655fe285

COCOAPODS: 1.11.0
COCOAPODS: 1.11.3
13 changes: 12 additions & 1 deletion samples/osx/configcatsample-objc/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,31 @@

int main(int argc, const char * argv[]) {
@autoreleasepool {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

ConfigCatClient* client = [ConfigCatClient getWithSdkKey:@"PKDVCLf-Hq-h-kCzMp-L7Q/HhOWfwVtZ0mb30i9wi17GQ" configurator:^(ConfigCatOptions* options){
// Info level logging helps to inspect the feature flag evaluation process.
// Use the default Warning level to avoid too detailed logging in your application.
options.logLevel = LogLevelInfo;

[options.hooks addOnReadyWithHandler:^(enum ClientReadyState state) {
dispatch_semaphore_signal(semaphore);
}];
}];

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (uint64_t)(5 * NSEC_PER_SEC)));

// Creating a user object to identify your user (optional).
ConfigCatUser* userObject = [[ConfigCatUser alloc]initWithIdentifier:@"Some UserID"
email:@"[email protected]"
country:@"CountryID"
custom:@{@"version": @"1.0.0"}];

NSString *featureName = @"isPOCFeatureEnabled";
BOOL value = [client getBoolValueSyncFor:featureName defaultValue:false user:userObject];

ConfigCatSnapshot* snapshot = [client snapshot];

BOOL value = [snapshot getBoolValueFor:featureName defaultValue:false user:userObject];
NSLog(@"%@: %@", featureName, value ? @"Yes" : @"No");
}
return 0;
Expand Down

0 comments on commit 5cd5a67

Please sign in to comment.