Skip to content

fix: match broadcast system UI labels in any device language - #35

Merged
Timo972 merged 2 commits into
masterfrom
timo/dro-3151-auto-broadcast-start-doesnt-work-on-non-english-devices
Sep 24, 2026
Merged

Timo972 merged 2 commits into
masterfrom
timo/dro-3151-auto-broadcast-start-doesnt-work-on-non-english-devices

Conversation

@Timo972

@Timo972 Timo972 commented Sep 24, 2026 •

Copy link
Copy Markdown

Problem

/broadcast/start finds the system confirmation sheet's button by its English label ("Start Broadcast", falling back to any button whose label begins with "Start"). It finds the stale "Screen Broadcasting" alert by "OK" / "Go to Application". When the device's system language isn't English, neither lookup matches. In German, for example, the button reads "Übertragung starten". The start then times out, unless the caller passes the localized labels explicitly.

Fix

ReplayKit ships these strings in every language iOS supports:

UI element ReplayKit key
Confirm button CONTROL_CENTER_START_BROADCAST
Alert dismiss button BROADCAST_FAILED_ALERT_OK_BUTTON
Alert "Go to Application" button BROADCAST_FAILED_ALERT_GO_TO_APP_BUTTON
  • +[FBBroadcastManager replayKitLabelsForKey:] reads a key from ReplayKit's Localizable.strings in all of its localizations. The device's preferred localizations come first. A .loctable layout is also handled. The result is cached per key.
  • Matching uses every language, not only the current one. The system UI can be rendered in a different language than the runner's own preferences (e.g. a per-app language override), and each localization's string is distinct UI text.
  • The confirm button is now found with a single label IN %@ query per app, instead of one existence probe per label. The English "Start" prefix match stays as a last resort.
  • The alert is still identified structurally: exactly two buttons, one matching the dismiss labels and the other matching the go-to-application labels.
  • confirmButtonLabels, dismissButtonLabels and goToApplicationButtonLabels are now matched in addition to the system labels instead of replacing them. Existing callers keep working.
  • docs/broadcast-extension.md is updated to match.

Testing

  • New FBBroadcastLabelsTests (UnitTests, iOS Simulator) checks that the English, German, Chinese and Turkish labels resolve, and that an unknown key yields an empty list. All three tests pass.
  • WebDriverAgentLib builds for generic/platform=iOS with no new warnings.
  • Not yet verified end to end on a physical device with a non-English system language.

🤖 Generated with Claude Code

Timo972 and others added 2 commits September 24, 2026 18:53
The broadcast start dance located the confirmation sheet's button by its
English label ("Start Broadcast", with a "Start" prefix fallback) and the
stale "Screen Broadcasting" alert by "OK" / "Go to Application". On devices
running another system language (e.g. German: "Übertragung starten") the
confirm button was never found and the start timed out.

Resolve these labels at runtime from ReplayKit's own localization tables,
covering every localization it ships, so matching no longer depends on the
system language. Request-supplied label arguments are now matched in
addition to the system labels instead of replacing them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Timo972
Timo972 merged commit b161c3f into master Sep 24, 2026
45 of 56 checks passed
@Timo972
Timo972 deleted the timo/dro-3151-auto-broadcast-start-doesnt-work-on-non-english-devices branch September 24, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants