Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 8f5b82d

Browse files
committed
update reddeme, comments
1 parent 561e1d4 commit 8f5b82d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@ Currently [Optimizely](https://www.optimizely.com/) does not offer a dedicated f
88

99
## Usage
1010

11+
**You need to init and set up user before using an functions**
12+
1113
functions supported:
1214
[`isFeatureEnabled`](https://docs.developers.optimizely.com/full-stack/docs/is-feature-enabled-android)
1315
[`getAllFeatureVariables`](https://docs.developers.optimizely.com/full-stack/docs/get-all-feature-variables-android).
16+
[`getAllEnabledFeatures`](https://docs.developers.optimizely.com/full-stack/docs/get-all-feature-variables-android).
17+
[`activategetVariable`](https://docs.developers.optimizely.com/full-stack/docs/get-all-feature-variables-android).
1418
[`getVariable`](https://docs.developers.optimizely.com/full-stack/docs/get-all-feature-variables-android).
1519
[`trackEvent`](https://docs.developers.optimizely.com/full-stack/docs/get-all-feature-variables-android).
1620

1721
```dart
1822
import 'package:optimizely_dart/optimizely_dart.dart';
19-
...
2023
await OptimizelyPlugin.initOptimizelyManager('your_optimizely_sdk_key');
21-
bool featureEnabled = await OptimizelyPlugin.isFeatureEnabled('your_flag', 'some_user@xyz.com');
2224
...
23-
Map<String, dynamic> variables = await OptimizelyPlugin.getAllFeatureVariables(
24-
'your_flag_with_vars',
25-
'some_user@xyz.com',
26-
{'attribute_key': attribute_value},
27-
);
28-
String variable_value = variables['variable_name'];
25+
unawaited(OptimizelyPlugin().setUser(_personManager.person?.id, {'isLoggedIn':true}));
26+
...
27+
bool featureEnabled = await OptimizelyPlugin.isFeatureEnabled('your_flag', 'some_user@xyz.com');
2928
3029
var variation = await OptimizelyPlugin().getVariation('your_flag', 'some_user@xyz.com',{});
3130

lib/optimizely_dart.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class OptimizelyPlugin {
5353
return Map<String, dynamic>.from(featureVariables);
5454
}
5555

56-
//https://docs.developers.optimizely.com/full-stack/docs/run-a-b-tests
57-
//TODO: deprecate: use activateGetVariation
5856
Future<String?> getVariation(
5957
String featureKey,
6058
userID,

0 commit comments

Comments
 (0)