Skip to content

Commit 903bff0

Browse files
authored
Remove non-public buttonPressed: selector from broadcast picker activation (#1138)
## Summary Apple's automated App Review flags the literal `buttonPressed:` selector string in application binaries (ITMS-90338 / Guideline 2.5.1) and blocks App Store submissions. Since the plugin compiles `ios/Classes/**` into every app, any iOS app using `livekit_client` is exposed — even if it never uses screen sharing or ReplayKit. `BroadcastManager.showPicker(for:)` constructed and performed the private selector to programmatically activate the system broadcast picker (reached via `setScreenShare` → `broadcastRequestActivation` method channel). It now activates the picker using only public API: locate the picker's `UIButton` subview and fire it via `sendActions(for: .touchUpInside)`. If the button is ever not found (e.g. a future OS changes the view hierarchy), a warning is logged instead of silently no-opping. No API changes; runtime behavior is identical. ## Verification - `rg buttonPressed ios/ macos/` returns no matches, so the selector string no longer reaches downstream binaries - `swiftc -typecheck` against the iOS simulator SDK passes for the changed file and its dependencies
1 parent fdcedaa commit 903bff0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Remove non-public buttonPressed: selector from broadcast picker activation"

ios/Classes/BroadcastManager.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import Combine
1818
import ReplayKit
19+
import UIKit
1920

2021
@available(iOS 13.0, *)
2122
final class BroadcastManager {
@@ -44,8 +45,10 @@ final class BroadcastManager {
4445
view.preferredExtension = preferredExtension
4546
view.showsMicrophoneButton = false
4647

47-
let selector = NSSelectorFromString("buttonPressed:")
48-
guard view.responds(to: selector) else { return }
49-
view.perform(selector, with: nil)
48+
guard let button = view.subviews.compactMap({ $0 as? UIButton }).first else {
49+
print("[LiveKit] Unable to find button in RPSystemBroadcastPickerView")
50+
return
51+
}
52+
button.sendActions(for: .touchUpInside)
5053
}
5154
}

0 commit comments

Comments
 (0)