startAppShare returns false

Description
I’ve followed all the documents. The ‘Screen’ option is in the Share menu. But after I call the startAppShare() method, it returns false and nothing happens. Here is my code in swift:

func onClickShareScreen(_ parentVC: UIViewController!) {
let ms = MobileRTC.shared()?.getMeetingService()
if ms != nil {
if (ms?.isStartingShare())! {
ms?.stopAppShare()
print(“Stop Screen Sharing”)
}
else {
ms?.startAppShare()
print(“Start Screen Sharing”)
}
}
}
Any idea how to solve it?

Which version?
latest version

Smartphone (please complete the following information):

  • Device: iPhone7
  • OS: IOS12.2

Hi yuhan,
Thanks for using Zoom SDK. Are you following the instructions this doc:https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/mastering-zoom-sdk/in-meeting-function/zoom-meeting-ui/screen-share? Have you configured the iOS broadcasting feature as mentioned in https://support.zoom.us/hc/en-us/articles/115005890803-iOS-Screen-Sharing? Due to the screen sharing constraints from Apple, if you would like to do screen sharing, you need to use the iOS broadcasting feature and start the screen sharing from there.

Let me know if this is not the case or if you have any other questions. Thanks!

Yep, I followed the documents step by step. I didn’t see my app after I pressed Record icon. Please check my code to see if I done something wrong on implementing the onClickShareScreen method. Because I couldn’t find any information for this part in your documents.

Hi,
Thanks for the reply.

  1. If you didn’t see your app after pressing the Record icon, you might need to double check your app group configuration.
  2. The onClickShareScreen method is just helping you to show the Share button in the meeting UI. It won’t affect the screen sharing feature. You don’t actually need the parts in your code snippet to do screen sharing. As long as your meeting is on and live, by using the iOS broadcasting feature, the screen sharing feature will be triggered automatically. (If you configured correctly)

Hope the above info helps. Let me know if you have any other questions. Thanks!

Problem solved! Thanks for your help!

One more question here: How to navigate back to my original view controller after I start the screen share?

Hi,
Glad to hear that the problem was resolved. Once you start the screen sharing, there should be a button called “Stop share”, by pressing that, the screen sharing will stop and bring you back to your original view controller. If you would like to present your original view controller while screen sharing, you can use methods like presentViewController or pushViewController to present your view.

Hope this helps. Thanks!

Hi Yuhan
I am blocked at the same point. can you share me your experience about implement this delegate function?
onClickShareScreen()
I can see the “Screen” item, but it does not start record screen after I clicke the “Screen” button.

check this out, it’s the same function:
https://support.zoom.us/hc/en-us/articles/115005890803-iOS-Screen-Sharing

you will have to swipe up, deep press the record button and select your app to start the screen share.

Hi yuhan
you mean I just keep this function(onClickShareScreen()) as empty?

That’s correct. You don’t have to do anything in that function.

wow, do you know how to show the record UI which is same as Zoom client?

Hi guan_bj,

Thanks for the reply. Please see my reply in ZOOM iOS SDK Screen Share and see if it helps. Let me know if any other questions. Thanks!

Hi, How did you resolved this, can you please help, I am able to see Screen option in my Meeting UI when click on Share Button but nothing happens clicking on it.

I have setup Broadcast Uploaded not Broadcast UI. Do I need to set up Broadcast UI as well?
Please help me with some steps for that as well.

Hi Anand_Vyass,

Thanks for the reply. You may follow the instruction here to implement the screen sharing feature on iOS: https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/mastering-zoom-sdk/in-meeting-function/zoom-meeting-ui/screen-share

Hope this helps. Thanks!

The documentation is not clearly explaining what is to be done to get the Screen share broadcasting UI in our App, No where it is mentioned in your documents

I hope this will help many of devs like me., I appreciate Zoom have handled everything, just we need to have few lines of code to add screen share in our App, (Prerequisite -Add Broadcast Upload extension as they shown in their MobileRTCSample)

To show Broadcast Picker when Share button clicked in Zoom Meeting UI do the following
Import Replay Kit
#import <ReplayKit/ReplayKit.h>
then write following code in onClickShareScreen method.

    RPSystemBroadcastPickerView *broadcastView = [[RPSystemBroadcastPickerView alloc] initWithFrame:CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width/2, UIScreen.mainScreen.bounds.size.height/2)];
            broadcastView.preferredExtension = @"budnle Id of Broadcase Upoad Extension";
            SEL buttonPressed = NSSelectorFromString(@"buttonPressed:");
            if([broadcastView respondsToSelector:buttonPressed]){
                [broadcastView performSelector:buttonPressed withObject:nil];
            }

This will automatically open the Broadcast picker with your Extension and then all done… Booom

Then clicking on broadcast anywhere will hide the broadcast picker and again when you want to stop screen sharing just click on Stop Sharing button on Meeting UI.

This should be documented, that how it can be triggered, Its really easy but the document does not mention it hence making it look extremely difficult.

Hi Anand_Vyass,

Thanks for the reply and the suggestion. I will forward this to the team and glad to hear that it is working. Happy Zooming! :slight_smile:

Hi @Anand_Vyass,

I’m trying to do the same as you but in swift…

I created a RPSystemBroadcastPickerViewand I put my extension as preferredExtension, and I put this broadcastPicker as a subview of ParentVC view, but nothing happens…

Can you show me your onClickShareScreen method code?

My code is:

func onClickShareScreen(_ parentVC: UIViewController) {
guard let service = MobileRTC.shared().getMeetingService() else { return }

    if service.isStartingShare() {
        service.stopAppShare()
    } else {
        service.startAppShare()
        
        let broadcastPicker = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width/2, height: UIScreen.main.bounds.size.height/2))
        broadcastPicker.preferredExtension = ""

        parentVC.view.addSubview(broadcastPicker)
        parentVC.view.bringSubviewToFront(broadcastPicker)
    }

Thanks in advance