Skip to content

fix: use non-deprecated LDClient.start with startWaitSeconds - #58

Merged
tanderson-ld merged 1 commit into
mainfrom
devin/1786352687-fix-deprecated-start
Aug 12, 2026
Merged

fix: use non-deprecated LDClient.start with startWaitSeconds#58
tanderson-ld merged 1 commit into
mainfrom
devin/1786352687-fix-deprecated-start

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The example called the deprecated LDClient.start(config:context:) overload (deprecated in the iOS SDK: "Use LDClient.start(config: context: startWithSeconds: completion:) to initialize the SDK with a defined timeout"), so building it emitted a deprecation warning. Switched to the supported timeout overload, matching what the sibling examples already do (hello-ios-swift uses startWaitSeconds: 30, hello-tvos uses 10). Also made config a let since it is never mutated (Swift warns otherwise).

-var config = LDConfig(mobileKey: sdkKey, autoEnvAttributes: .enabled)
-LDClient.start(config: config, context: context)
+let config = LDConfig(mobileKey: sdkKey, autoEnvAttributes: .enabled)
+LDClient.start(config: config, context: context, startWaitSeconds: 10)

No SDK version change was needed: Package.resolved already pins ios-client-sdk 11.3.0 and swift-eventsource 3.3.0, which are the latest releases within the configured upToNextMajorVersion 11.0.0 requirement.

Testing

No Xcode on Linux, so this was verified statically against the SDK source at tag 11.3.0 (the deprecation attribute and the replacement signature start(config:context:startWaitSeconds:completion:)). The repo's own CI builds the workspace and the Run workflow launches the app and asserts the window text, which covers the behavior change.

Link to Devin session: https://app.devin.ai/sessions/b10ffc27579444828c87aa46bea06a52
Requested by: @jsonbailey


Note

Overview
Updates the hello-macos sample so LaunchDarkly initializes with the non-deprecated LDClient.start(config:context:startWaitSeconds:) API instead of the two-argument overload that triggers a deprecation warning.

LDConfig is now held in a let because it is not mutated, and startup uses a 10 second wait for the client to become ready—aligned with the other platform examples in this repo.

Reviewed by Cursor Bugbot for commit 77501b2. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

@kinyoklion
kinyoklion marked this pull request as ready for review August 10, 2026 22:07
@kinyoklion
kinyoklion requested a review from a team as a code owner August 10, 2026 22:07
@tanderson-ld
tanderson-ld self-requested a review August 12, 2026 14:33
@tanderson-ld
tanderson-ld merged commit dd088e9 into main Aug 12, 2026
6 checks passed
@tanderson-ld
tanderson-ld deleted the devin/1786352687-fix-deprecated-start branch August 12, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants