Search code examples
iosxamarinxamarin.formsios-extensions

Xamarin iOS - Broadcast Upload Extension - how to invoke


Recently I added Broadcast Upload Extension to Xamarin.Forms project however I can't find a way how to invoke the extension and present it to the user from the container app.

How would I invoke the extension and present it to the user? Through OpenUrl and it's bundle identifier?


Solution

  • Needs to be invoked like this:

    var bundle = NSBundle.MainBundle.GetUrlForResource("Foo.iOS.ScreenShareExtensionUI", "appex", "PlugIns");
    
                RPScreenRecorder.SharedRecorder.StartRecording(true, error =>
                {
                    if (error != null)
                        LogService.Log(error.LocalizedFailureReason, LogService.LogLevel.ERROR, "StartRecording");
                });
                RPBroadcastActivityViewController.LoadBroadcastActivityViewController(bundle.AbsoluteUrl.ToString(), (controller, error) =>
                {
                    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(controller, true, null);
    
                    RPBroadcastActivityViewController = controller;
                });