getUserByUserID always returns nil

Description
I’m getting user’s ID inside onUserAudioStatusChange delegate and using it to get ZoomSDKUserInfo instance using getUserByUserID method executed on meeting action controller, but it always returns nil.

It’s nil no matter when the event is triggered - after joining the meeting and connecting to audio, after clicking on mute / unmute.

Exactly the same code works fine in your Sample App. So I’m wondering what’s the missing piece here.

func onUserAudioStatusChange(_ userAudioStatusArray: [Any]!) {

    for userAudioStatus in userAudioStatusArray as! [ZoomSDKUserAudioStauts] {
        let userID: UInt32 = userAudioStatus.getUserID()

        if (self.meetingActionController == nil) {
            self.meetingActionController = ZoomSDK.shared()?.getMeetingService()?.getMeetingActionController()
        }
        let userInfo: ZoomSDKUserInfo? = self.meetingActionController!.getUserByUserID(userID)
                
        if(userInfo != nil && userInfo!.isMySelf())
        {
            self.mySelfUserInfo = userInfo!
        }
    }

}

Which version?
4.6.21666.0427

Screenshots

Macbook:

  • Device: MacBook Pro (Retina, 15-inch, Mid 2015)
  • OS: macOS Catalina 10.15.2 (19C57)
  • Xcode: Version 10.2.1 (10E1001)
1 Like

Hi @dmiskiew,

Try to get user info in func onUserInfoUpdate( _ userID: UInt32). Also please take a look at getParticipantsList() method of ZoomSDKMeetingActionController, you can use it to query connected users.

Good luck!

Hey @dmytro,

thanks for your suggestions!

Unfortunately getting user inside the func onUserInfoUpdate( _ userID: UInt32) doesn’t work - it returns nil.

And getParticipantsList() return’s nil too…

Hi @dmiskiew,

Thanks for the post. Please have a try to retrieve userID from (void)onUserJoin:(NSArray*)array.

Hope this helps. Thanks!

Thanks for the answer @Carson_Chen!
Retrieving userID from (void)onUserJoin:(NSArray*)array doesn’t help.
But I finally figured it out by deleting line by line from the sample code.

The nil is returned if there’s no ZoomSDKMeetingServiceDelegate.
Connecting the delegate with onMeetingStatusChange, onWaitMeetingSessionKey etc solved this problem.

Hi @dmiskiew,

Thanks for the reply and glad to hear that the problem has resolved. I will pass this to the engineering team to further enhance this. Pardon the confusion here.

Thanks!