Screen Sharing button not working

I’m trying to share my screen following documentation steps, but I have a problem. I can’t share my screen.

onClickShareScreen function is called and in this function I call to MobileRTC.shared().getMeetingService().startAppShare(), but then nothing happens. I think I did something bad, because this step isn’t occur: “The SDK should notify your app using the (void)onSinkMeetingActiveShare:(NSUInteger)userID instance with the user ID who started the screen share.”

Can you help me, please?

Thanks in advance,

Roberto

Hi Roberto,

Thanks for the post. Which doc are you referring to? If you follow the doc here:https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/mastering-zoom-sdk/in-meeting-function/zoom-meeting-ui/screen-share, you will need to create a broadcast extension, and then invoke the screen recording feature in the system for screen sharing.

Please have a try. Thanks!

Thanks for the answer @carson.zoom,

I created a broadcast extension, defined group, set onClickShareScreen function:

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

but then… func onSinkMeetingActiveShare( _ userID: UInt) isn’t been called.

I don’t know If I need to do some step after “startAppShare()”, but It isn’t working.

Hi @rob.gomez.mu,

Thanks for the reply. Actually the startAppShare and stopAppShare is for the appShareWithView interface(We have another method to share screen but we do recommend using the broadcast extension). The broadcast extension is rely on Apple’s services so you may use something like https://developer.apple.com/documentation/replaykit/rpsystembroadcastpickerview?language=objc to invoke the screen sharing. Or you could manually start the screen recording by following the instruction here: https://support.zoom.us/hc/en-us/articles/115005890803-iOS-Screen-Sharing

Hope this helps. Thanks!

I didn’t see any real solution, Do you have any complete share screen example to show? Because I think that documentation isn’t clear :frowning:

I’ve been trying screen share for weeks and still not able to broadcast. A real sample would be really helpful.

1 Like

@carson.zoom my ‘onClickShareScreen’ function 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 = "MyExtension"

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

Is it correct?

Hi @rob.gomez.mu,

If you are using the broadcast extension to do screen sharing, you do not need the startAppShare and the stopAppShare. You could simply implement the broadcast picker in the onClickShareScreen method like the following:

- (void)onClickShareScreen:(UIViewController *)parentVC
{
     if (@available(iOS 12.0, *)) {
         RPSystemBroadcastPickerView *broadcastView = [[RPSystemBroadcastPickerView alloc] init];
            broadcastView.preferredExtension = @"Extension bundle ID";
            broadcastView.tag = "NSInteger here";
            
            [self.mainVC.view addSubview:broadcastView];
         
         broadcastView = [self.mainVC.view viewWithTag:"NSInteger here"];
         if (!broadcastView) return;

         for (UIView *subView in broadcastView.subviews) {
             if ([subView isKindOfClass:[UIButton class]])
             {
                 UIButton *broadcastBtn = (UIButton *)subView;
                 [broadcastBtn sendActionsForControlEvents:UIControlEventAllTouchEvents];
                 break;
             }
         }
     }
}

Then you could trigger the picker by pressing the share button.

Hope this helps. Thanks!

hi @carson.zoom
how we can broadcast share screen if i am using custom meeting ui

Hi @arsallion313,

Thanks for the reply. For Custom UI, it will be the same way as how it is implemented in the Zoom default UI.

Thanks!

Hello
i am trying to enable screen share to default zoom ui is it possible add share button?

when i click on share content button after meeting is joined it just shows me two button tiles for “photos and website url”

i have followed steps mentioned here Screen sharing

i have also added MobileRTCMeetingShareActionItemDelegate to my view controller

Hi @sandy.rishi573, thanks for using the dev forum.

Are you trying to share via ReplayKit as outlined in our documentation? If so, there are several steps outlined in our documentation to enable this, so it is impossible to tell what exactly is going wrong in your implementation without more specific information. Have you looked at the troubleshooting page yet?

Thanks!

yes i am trying to share via ReplayKit as mentioned in (https://marketplace.zoom.us/docs/sdk/native-sdks/iOS/mastering-zoom-sdk/in-meeting-function/screen-share/).

after a few try’s based on that troubleshooting doc i was able to get that share button but when i try to share my screen in a meeting i am getting a new error

error Popup
Screen Broadcasting - live broadcast to zoom has stopped due to : Connection failed, restart broadcasting to zoom for screen sharing …

Hi @sandy.rishi573,

Can you please let me know specifically what changes have been made based on the troubleshooting documentation?

Thanks!