Hi,
I am trying to subscribe to all topics by following the tutorial. But, it didn’t work.
So, I started to break that function into multiple individual calls to find out what is failing. I observed the function “CometChat.getJoinedGroups()” is failing and gives the warning I mentioned in. the title.
Here, is the code snippet of function I am calling in my app
export const TestSubscription = async () => {
try {
let user = await CometChat.getLoggedinUser()
console.log('Logged in user', user)
let groups = await CometChat.getJoinedGroups();
console.log('Joined Groups', groups)
} catch (error) {
console.log('Error', error)
}
}
In my app log I see the the user object getting logged and after that it shows the same warning.
Logged in user {“authToken”: “MY_AUTH_TOKEN”, “blockedByMe”: false, “hasBlockedMe”: false, “lastActiveAt”: 1590072223, “name”: “USER_NAME”, “role”: “customer”, “uid”: “MY_UID”}
WARN Possible Unhandled Promise Rejection (id: 3):
Error: INVALID_STATE_ERR
I am suspecting because of this it is not able to subscribe to all topics.
My Environment Details:
react-native: 0.61.5
@cometchat-pro/react-native-chat: 2.0.8
I am using functional components and react Hooks in my project if that matters.