I am trying to add Twilio Chat to my react native project. I'm getting an error with the name SyncError
and code 0. I'm just trying to confirm it's connected at this point. Here's my basic setup.
Import at the top
import {Client as Chat} from 'twilio-chat'
Inside my class
componentDidMount = async () => {
console.log(Chat);
const token = await AsyncStorage.getItem('auth-token');
axios.get(config.apiUrl + '/chat/details', { headers: { Authorization: token } })
.then(res => {
console.log(res);
Chat.create(res.data.twilioToken)
.then(client => {
console.log('client', client);
this.subscribeToAllChatClientEvents(client);
})
.catch(error => {
console.log('There was an error', error);
});
})
.catch(err => {
console.log(err);
})
}
The error also mentions an "Unhandled promise rejection" but I've included any catch
blocks where needed.
Thanks for any help.