Before Creating a New Topic:
I have cloned VideoSDK-ReactNative-Quickstart app same problem i am facing. and i have created new app using cli and followed official guide but still facing same issue.
I have created market place account and activate apps using Server-to-Server OAuth and replace client key and client secret in code. but still i can not join session.
Errors
Not getting any error.
Which React Native Video SDK version?
1.12.1
Video SDK Code Snippets
import React, {useState, useRef} from ‘react’;
import {EmitterSubscription, Text, View, Button} from ‘react-native’;
import {
ZoomVideoSdkProvider,
useZoom,
ZoomVideoSdkUser,
EventType,
ZoomView,
VideoAspect
} from ‘@zoom/react-native-videosdk’;
const App = () => {
return (
<ZoomVideoSdkProvider
config={{
appGroupId: ‘{Your Apple Group ID here}’,
domain: ‘zoom.us’,
enableLog: true,
}}>
);
};
const Call = () => {
const zoom = useZoom();
console.log(“Zoom>>>>>>”, zoom.session)
const [users, setUsersInSession] = useState<ZoomVideoSdkUser>();
const [isInSession, setIsInSession] = useState(false);
const listeners = useRef<EmitterSubscription>();
const join = async () => {
const token =
‘eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBfa2V5IjoiVjJmS2dTMExTRGlyd09ZNS1URXE4ZyIsInJvbGVfdHlwZSI6MCwidHBjIjoiVGVzdCIsInZlcnNpb24iOjEsImlhdCI6MTcyNDMwNTUxNCwiZXhwIjoxNzI0MzA5MTE0fQ.Wr60FAbCyq5yc6jueD6mHs1j5nmzB4wGDTLLRbYLmok’;
console.log("token==", token)
const sessionJoin = zoom.addListener(EventType.onSessionJoin, async () => {
console.log("sessionJoin==")
const mySelf = new ZoomVideoSdkUser(await zoom.session.getMySelf());
const remoteUsers = await zoom.session.getRemoteUsers();
setUsersInSession([mySelf, ...remoteUsers]);
setIsInSession(true);
});
listeners.current.push(sessionJoin);
const userJoin = zoom.addListener(EventType.onUserJoin, async event => {
const {remoteUsers} = event;
const mySelf = await zoom.session.getMySelf();
const remote = remoteUsers.map(user => new ZoomVideoSdkUser(user));
setUsersInSession([mySelf, ...remote]);
});
listeners.current.push(userJoin);
const userLeave = zoom.addListener(EventType.onUserLeave, async event => {
const {remoteUsers} = event;
const mySelf = await zoom.session.getMySelf();
const remote = remoteUsers.map(user => new ZoomVideoSdkUser(user));
setUsersInSession([mySelf, ...remote]);
});
listeners.current.push(userLeave);
const sessionLeave = zoom.addListener(EventType.onSessionLeave, () => {
setIsInSession(false);
setUsersInSession([]);
sessionLeave.remove();
});
console.log('Attempting to join session...');
await zoom
.joinSession({
sessionName: 'Test',
sessionPassword: 'Test',
userName: 'Kinnari Kansara',
sessionIdleTimeoutMins: 10,
token: token,
audioOptions: {
connect: true,
mute: true,
autoAdjustSpeakerVolume: false,
},
videoOptions: {localVideoOn: true},
})
.then(() => {
console.log('Session join request sent');
})
.catch(e => {
console.log("Join session eror",e);
});
};
const leaveSession = () => {
zoom.leaveSession(false);
setIsInSession(false);
listeners.current.forEach((listener) => listener.remove());
listeners.current = ;
};
return isInSession ? (
{users.map((user) => (
))}
) : (
);
};
export default App;
this is my code.