export const authenticateSendbird = async (
userId: string,
accessToken: string
) => {
const appId = “just a random stuff here, I am hiding my appId”;
try {
SendBirdCall.init(appId);
await SendBirdCall.authenticate({
userId,
accessToken,
});
const query = base64.encode(
JSON.stringify({
app_id: appId,
user_id: userId,
access_token: accessToken,
})
);
Alert.alert("Sendbird auth successful");
console.log("Encoded query:", query);
} catch (e) {
console.log(Login failed. Error: ${e}
);
}
};
I am having issues with the RTCPeerConnection. I am getting this error, SendBirdCall needs ‘RTCPeerConnection’ in global, whenever I want to authenticate a user.
Hi, could you clarify the working environment? It looks like it’s Calls for React Native and I wonder which specific environment you’re running it on.
I am using react native expo
Thank you for the answer. Could you specify the configuration? Such as Expo version, whether you’re in Expo Go, etc.
Yes, I am using Expo go. I don`t if this is okay by you, but can we have a google meet? I really need your help sir.
Sure, but first make sure that Expo Go has some limitation in native module utilization because Expo Go doesn’t have the native packages that are required for WebRTC. You can start from the Expo development build settings (not Expo Go). If your problem persists after the settings, I shall be there for you.
Alright sir, thanks a lot. I will checkout your solution.
1 Like
I am still having the same problem. When do you prefer us to have the meeting? Are you okay with tomorrow, Tuesday? Let me know the time as well, I will be available.
I found something suspicious before jumping into a call. It looks like you’re using Calls for mobile web. You can go to the following link which is the repo for Calls React Native. Hope this help.
Thanks for the suggestion. Whenever I try to test the app on Expo go I get this error (NOBRIDGE) ERROR Warning: Error: The package ‘@sendbird/calls-react-native’ doesn’t seem to be linked. Make sure:
- You rebuilt the app after installing the package
- You are not using Expo managed workflow
Is there any other way I can test the app or is there anything I am doing wrong?
If you see “Using Expo Go” in metro bundler, you can switch it to development build by pressing ‘s’. Or you can start the metro with npx expo start --dev-client
.