Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 467
Milan Nosáľ Avatar asked Sep 13 '18 11:09

Milan Nosáľ


4 Answers

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

like image 181
MarginD Avatar answered Nov 20 '22 14:11

MarginD


enter image description here

Note that this is for ANY iOS Version:

I just burned a full day on this. When you add the BroadCast extension, Apple will automatically add the highest possible iOS Version for the deployment target. You need to make sure this isn't higher than your physical device's iOS Version. You won't get any build errors, they just won't show your app in the broadcast extension list.

like image 42
Dr. Mr. Uncle Avatar answered Nov 20 '22 13:11

Dr. Mr. Uncle


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.

like image 1
Bws Sluk Avatar answered Nov 20 '22 14:11

Bws Sluk


You can find your exactly preferedExtension here:

image

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

like image 1
ANDYNVT Avatar answered Nov 20 '22 13:11

ANDYNVT