Skip to content

Commit e80c0df

Browse files
Update README.md to correct method signatures (#38)
* Update README.md to correct method signatures * Update README.md * try await
1 parent e8e69ab commit e80c0df

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[Eppo](https://www.geteppo.com/) is a modular flagging and experimentation analysis tool. Eppo's iOS SDK is built to make assignments for single user client applications. Before proceeding you'll need an Eppo account.
66

7+
The [primary documentation](https://docs.geteppo.com/sdks/client-sdks/ios/) explains the overall architecture and in-depth usage guides.
8+
79
## Features
810

911
- Feature gates
@@ -34,7 +36,7 @@ It is recommended to wrap initialization in a `Task` block in order to perform n
3436

3537
```swift
3638
Task {
37-
try await EppoClient.initialize(apiKey: "SDK-KEY-FROM-DASHBOARD");
39+
try await EppoClient.initialize(sdkKey: "SDK-KEY-FROM-DASHBOARD");
3840
}
3941
```
4042

@@ -44,10 +46,10 @@ Assignment is a synchronous operation.
4446

4547
```swift
4648
let assignment = try eppoClient.getStringAssignment(
47-
"new-user-onboarding",
48-
user.id,
49-
user.attributes,
50-
"control"
49+
flagKey: "new-user-onboarding",
50+
subjectKey: user.id,
51+
subjectAttributes: user.attributes,
52+
defaultValue: "control"
5153
);
5254
```
5355

@@ -62,10 +64,10 @@ public class AssignmentObserver: ObservableObject {
6264
do {
6365
// Use the shared instance after it has been configured.
6466
self.assignment = try EppoClient.shared().getStringAssignment(
65-
"new-user-onboarding",
66-
user.id,
67-
user.attributes,
68-
"control"
67+
flagKey: "new-user-onboarding",
68+
subjectKey: user.id,
69+
subjectAttributes: user.attributes,
70+
defaultValue: "control"
6971
);
7072
} catch {
7173
self.assignment = nil
@@ -85,12 +87,12 @@ public class AssignmentObserver: ObservableObject {
8587
Task {
8688
do {
8789
// The initialization method has controls to maintain a single instance.
88-
try await EppoClient.initialize(apiKey: "SDK-KEY-FROM-DASHBOARD");
90+
try await EppoClient.initialize(sdkKey: "SDK-KEY-FROM-DASHBOARD");
8991
self.assignment = try EppoClient.shared().getStringAssignment(
90-
"new-user-onboarding",
91-
user.id,
92-
user.attributes,
93-
"control"
92+
flagKey: "new-user-onboarding",
93+
subjectKey: user.id,
94+
subjectAttributes: user.attributes,
95+
defaultValue: "control"
9496
);
9597
} catch {
9698
self.assignment = nil
@@ -175,7 +177,7 @@ func segmentAssignmentLogger(assignment: Assignment) {
175177
)
176178
}
177179

178-
eppoClient = EppoClient("mock-sdk-key", assignmentLogger: segmentAssignmentLogger)
180+
eppoClient = try await EppoClient.initialize(sdkKey: "mock-sdk-key", assignmentLogger: segmentAssignmentLogger)
179181
```
180182

181183
## Philosophy

0 commit comments

Comments
 (0)