iosswiftios12replaykit

ReplayKit's RPSystemBroadcastPickerView not showing preferredExtension


I am using RPSystemBroadcastPickerView to show a picker view, from which a user can select a broadcast service to record the screen. Based on documentation, preferredExtension should allow me to set which broadcast extension should the picker show.

The code is super simple:

let broadcastPickerView = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 51, height: 51))
view.addSubview(broadcastPickerView)
broadcastPickerView.preferredExtension = "com.milan.nosal.broadcast-extension"
broadcastPickerView.backgroundColor = .clear
broadcastPickerView.showsMicrophoneButton = false

where "com.milan.nosal.broadcast-extension" is the bundle identifier of the extension I want the picker to offer (I checked its correctness multiple times).

However, when the control is tapped, at first the pop up shows empty selection:

enter image description here

After you close it, and tap the control again, it shows the correct extension. This only happens when the app is installed (or reinstalled), after it shows, then it shows always.

Is this the iOS 12 beta bug, or am I doing something incorrectly? Can I "preregister" the extension to work around this?

EDIT:

After publishing the app, we encountered the same problem with our users, but this time not even tapping the control multiple times helps - the picker is always empty! It seems that the extension is installed correctly, because it can be launched from control center.

Running on official release now.


Solution

  • I think it is the apple's bug, but it was fixed in iOS 12.2 after I tested it.