0

I am developing an app using Broadcast Upload Extension - I would like to know how to pass parameters into the BroadcastViewController so I can them pass them onto the CompleteRequest method (userSetup parameter). Or am I suppose to reference the Container app somehow and get the parameters from there?

code from BroadcastViewController:

  public partial class BroadcastViewController : UIViewController
        {
            protected BroadcastViewController(IntPtr handle) : base(handle)
            {
                // Note: this .ctor should not contain any initialization logic.
            }

            public void UserDidFinishSetup()
            {
// NEED TO OBTAIN HERE PARAMETERS
                System.Diagnostics.Debug.WriteLine("ScreenShareExtensionUI: UserDidFinishSetup");
                // Broadcast url that will be returned to the application
                var broadcastURL = NSUrl.FromString("http://broadcastURL_example/stream1");

                // Service specific broadcast data example which will be supplied to the process extension during broadcast
                var keys = new[] { "channelName", "token", "appId" };
                var objects = new[] { "channelName", "token", "appId" };
                var setupInfo = NSDictionary.FromObjectsAndKeys(objects, keys);

1 Answer 1

1

I solved the issue by using App Groups capability. This allows me to fill in the parameters in the container app and then retrieve them in the extension like this:

var plist = new NSUserDefaults("group.com.foo.ss", NSUserDefaultsType.SuiteName);
            var agoraApi = plist.StringForKey("agoraApi");
            var agoraRoomId = plist.DoubleForKey("agoraRoomId");
            var agoraToken = plist.StringForKey("agoraToken");
            var agoraUserId = plist.DoubleForKey("agoraUserId");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.