-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Niko/IOS docs to new template #551
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for eppo-data-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall lgtm; code samples compile. Please give me a ping when addressed the few ❌ and I'll take another read. Thank you!
|
||
1. Choose `Package Dependencies` | ||
2. Click `+` and enter package URL: `[email protected]:Eppo-exp/eppo-ios-sdk.git` | ||
3. Set dependency rule to `Up to Next Minor Version` and select `Add Package` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great call out - this is important for customers to be able to get the latest patches
} | ||
``` | ||
|
||
[Continue with the rest of the quickstart content...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -0,0 +1,60 @@ | |||
--- | |||
title: Quickstart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm ✔️
Task { | ||
try await EppoClient.initialize( | ||
sdkKey: "SDK-KEY-FROM-DASHBOARD", | ||
initialConfiguration: try Configuration( | ||
flagsConfigurationJson: Data(#"{ "pre-loaded-JSON": "passed in here" }"#.utf8), | ||
obfuscated: false | ||
) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified in xcode
If you'd like to initialize Eppo's client without performing a network request, you can use the `initializeOffline` method: | ||
|
||
```swift | ||
try EppoClient.initializeOffline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified in xcode
<ApiOptionRef | ||
name="timestamp" | ||
type="string" | ||
defaultValue="undefined" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty string for all https://github.com/Eppo-exp/eppo-ios-sdk/blob/main/Sources/eppo/Assignment.swift#L1
|
||
## How Assignments Work | ||
|
||
The SDK periodically retrieves configuration rules from the Eppo server that define how subjects should be allocated to variants. When you call an assignment function, the SDK evaluates these rules locally without making additional network requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ No polling in Swift - configuration loaded once on session start and whenever user calls load()
if assignment == "version-a" { | ||
showVersionA() | ||
} else if assignment == "version-b" { | ||
showVersionB() | ||
} else { | ||
showControl() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if assignment == "version-a" { | |
showVersionA() | |
} else if assignment == "version-b" { | |
showVersionB() | |
} else { | |
showControl() | |
} | |
switch assignment { | |
case "version-a": | |
showVersionA() | |
case "version-b": | |
showVersionB() | |
default: | |
showControl() | |
} |
totally correct as-is just a suggestion
let defaultConfig = """ | ||
{ | ||
"color": "#FF0000", | ||
"fontSize": 14, | ||
"fontFamily": "Roboto" | ||
} | ||
""" | ||
|
||
let config = try eppoClient.getJSONStringAssignment( | ||
flagKey: "ui-config", | ||
subjectKey: user.id, | ||
subjectAttributes: user.attributes, | ||
defaultValue: defaultConfig | ||
) | ||
|
||
// Parse and use the configuration | ||
if let jsonData = config.data(using: .utf8), | ||
let json = try? JSONSerialization.jsonObject(with: jsonData) as? [String: Any] { | ||
let color = json["color"] as? String | ||
let fontSize = json["fontSize"] as? Int | ||
let fontFamily = json["fontFamily"] as? String | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified in xcode
## Debugging Assignments | ||
|
||
You may encounter situations where a flag assignment produces unexpected values. The SDK provides debugging functions to help understand how assignments are being made: | ||
|
||
```swift | ||
let debugInfo = try eppoClient.getAssignmentDebugInfo( | ||
flagKey: flagKey, | ||
subjectKey: subjectKey, | ||
subjectAttributes: subjectAttributes | ||
) | ||
|
||
// Log debug information | ||
print("Assignment debug info: \(debugInfo)") | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ this API does not current exist in swift
1. Choose `Package Dependencies` | ||
2. Click `+` and enter package URL: `[email protected]:Eppo-exp/eppo-ios-sdk.git` | ||
3. Set dependency rule to `Up to Next Minor Version` and select `Add Package` | ||
4. Add to your project's target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere in the code examples please show how to import the package:
import EppoFlagging
Split iOS SDK Documentation into Multiple Pages
Changes Made
Restructured single iOS.md file into multiple focused pages:
Why?
Review instructions
Before merge