USER_LEFT Event Not Working For Mobile Devices

I am noticing an issue on Mobile Devices where window.JitsiMeetJS.events.conference.USER_LEFT is not firing when a user disconnects by refreshing the browser or closing it. A simple code example as such:

window.JitsiMeetJS.init();

            let token = 'x';

            options = buildOptions();

            window.JitsiMeetJS.setLogLevel(window.JitsiMeetJS.logLevels.ERROR);

            connection = new window.JitsiMeetJS.JitsiConnection(null, token, options.connection);

            connection.addEventListener(
                window.JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
                onConnectionSuccess);
            connection.addEventListener(
                window.JitsiMeetJS.events.connection.CONNECTION_FAILED,
                onConnectionFailed);
            connection.addEventListener(
                window.JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
                disconnect);

            connection.connect();

 function onConnectionSuccess(connection_id) {

            room = connection.initJitsiConference(getRoomName(), options.conference);

            try {

                window.JitsiMeetJS.createLocalTracks({ devices: localDevices })
                    .then(onLocalTracks)
                    .catch(error => {

                        console.error(error);
                    });

            } catch (e) {
                console.error(e);
            }

            room.on(
                window.JitsiMeetJS.events.conference.TRACK_ADDED,
                track => {
                    !track.isLocal() && onRemoteTrack(track);
                });
            room.on(
                window.JitsiMeetJS.events.conference.CONFERENCE_JOINED,
                onConferenceJoined);
            room.on(
                window.JitsiMeetJS.events.conference.USER_JOINED,
                onUserJoined);
            room.on(
                window.JitsiMeetJS.events.conference.USER_LEFT,
                onUserLeft);
            room.join();
            room.setReceiverVideoConstraint(720);

        }

//This is not being executed from mobile devices
function onUserLeft(id) {

console.log(id);
        }

On Laptops, I’ve tested on a Chrome Book, Mac Pro and Mac Air, the User Left event is fired when I close my browser to refresh the page. Testing on an iPad, IPhone and Andriod, the USER_LEFT event is not fired.

Any thoughts?

I don’t think that is a guarantee. You probably want to use a beforeunload handler to be sure.