ReplayKit's RPSystemBroadcastPickerView not showing preferredExtension

牧云@^-^@ 提交于 2019-12-04 17:02:31

问题


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:

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.


回答1:


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




回答2:


I have the same issue, looks like Xcode has some issues how to install broadcastExtension with you app. For me, It is related only for Debug mode. To see correct UI, try to enable broadcasting once in old way (control center -> deep touch -> start broadcast), after that in your BroadcastPickerView you will see correct UI (you are pushing iOS to update information about the extension). Cannot reproduce in release mode.




回答3:


You can find your exactly preferedExtension here:

When you add pickerView.preferredExtension exactly the Bundle Identifier, your app will be showed on the Recording App List. Hope this helps!




回答4:


If I do not set ".preferredExtension", I see all extensions on the list. I tested on iOS12 GM.



来源:https://stackoverflow.com/questions/52312814/replaykits-rpsystembroadcastpickerview-not-showing-preferredextension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!