Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions contents/tutorials/ios-remote-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Now, let's set up the remote config flag in PostHog to control our welcome messa
To show that message, let's create a simple UI in `ContentView.swift` that displays it. This requires:

- A basic view with a text element to display our message
- A `getFeatureFlagPayload()` call to fetch our remote config value
- A `getFeatureFlagResult()` call to fetch our remote config value
- A default message fall back if the remote config isn't available
- A refresh button to reload the message if we change the remote config

Expand Down Expand Up @@ -123,7 +123,8 @@ struct ContentView: View {
}

private func loadWelcomeMessage() {
if let message = PostHogSDK.shared.getFeatureFlagPayload("welcome-message") as? String {
let result = PostHogSDK.shared.getFeatureFlagResult("welcome-message")
if let message = result?.payload as? String {
welcomeMessage = message
} else {
welcomeMessage = "Welcome to the app!"
Expand Down
Loading