Hi all !
I’ve seen that the CometChat SDK for react native has issues with Expo, regarding the @cometchat-pro/react-native-calls module (Calling), but I just need to implement messages at the moment.
I am using a TS expo stack (~42.0.1), and the @cometchat-pro/react-native-chat module (v3.0.0). When I try to login, I get the following error :
const settings = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(this._APP_REGION).build();
CometChat.init(this._APP_ID, settings)
.then(_ => {
CometChat.login(cometChatId, this._APP_KEY)
.then(_ => console.log("Logged in"))
.catch(_=> console.log("error", _))
// Shows : {name: "TypeError", message: "Cannot read property 'get' of undefined"}
})
Although if I downgrade @cometchat-pro/react-native-chat to v2.0.7 (just to remove the integration react-native-calls entierly), the message indicates :
const settings = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(this._APP_REGION).build();
CometChat.init(this._APP_ID, settings)
.then(_ => {
CometChat.login(cometChatId, this._APP_KEY)
.then(_ => console.log("Logged in"))
.catch(_=> console.log("error", _))
// Shows : {code: "-1" details: {} message: "please initialize the cometchat before using login method", name: "COMETCHAT_INITIALIZATION_NOT_DONE"}
})
I’m not sure if those are two different issues, or if in the first case initialization failed as well and the error message would not be as explicit as in v2.0.7.
Do you guys have any idea of what I’m doing wrong ?