getCurrentUser() and getCurrentMeetingInfo() returning undefined

Description
Calls to getCurrentUser() and getCurrentMeetingInfo() immediately after successfully joining a meeting are both returning nothing at present. What am I doing wrong?

Code sample below includes console.log() for these functions statements that are both showing ‘undefined’.

Error
N/A

Which version?
1.8.6 (CDN)

To Reproduce(If applicable)
Code sample below:

        var leaveUrl = 'https://mydomain';

        ZoomMtg.setZoomJSLib('https://dmogdx0jrul3u.cloudfront.net/1.8.6/lib', '/av'); 
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();
       
        ZoomMtg.inMeetingServiceListener('onUserJoin', function (data) {
            console.log('onUserJoin: ', data);
        });
         
        ZoomMtg.inMeetingServiceListener('onMeetingStatus', function (data) {
            // {status: 1(connecting), 2(connected), 3(disconnected), 4(reconnecting)}
            console.log('onMeetingStatus', data);
        });

        ZoomMtg.init({
            leaveUrl: leaveUrl,
            isSupportAV: true,
            success: function() {
                ZoomMtg.join({
                    signature: JBA.signature,
                    apiKey: JBA.apiKey,
                    meetingNumber: JBA.meetingId,
                    userName: "Who am I?",
                    passWord: JBA.pwd,
                    success: function() {
                        var user = ZoomMtg.getCurrentUser({});
                        console.log('user: ', user);
                        var mtg = ZoomMtg.getCurrentMeetingInfo({});
                        console.log('mtg: ', mtg);
                    },
                    error(res) { 
                        console.log(res) 
                    }
                });
            }
        });

Screenshots
N/A

Device (please complete the following information):

  • Browser: Chrome 88, Edge 87

Additional context
N/A

Hey @johnrix,

Thank you for reaching out to the Zoom Developer Forum. The getCurrentUser() function is asynchronous so you’ll want to include a callback as the argument. We have an example of this in our Sample Web App:

I hope that helps! Let me know if you have any questions.

Thanks,
Max

Thanks @MaxM, that helps for sure.

That needs to be made clear in the documentation, as there are no parameters described for these methods there at present.

Hey @johnrix,

Thank you for the update, I’m glad to hear that helped! I agree that this should be covered in our documentation as well as the Sample Web App.

@shrijana.g Would it be possible to update the Web SDK reference examples (such as getCurrentUser()) to reflect that they need a success callback in order to function as expected?

Thanks,
Max

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.