React native application cannot add member to an existing getStream channel

45 Views Asked by At

I am creating an app where I use stream API (getstream-io). So, in my app a channel is created by one user for chat and then a second user tries to fetch that channel by its channel id, to add himself to the channel. The queryChannels method fails with the below error :

Uncaught (in promise) Error: StreamChat error code 70: QueryChannels failed with error: "1 channels match your query but cannot be returned because you don't have access to them. Did you forget to include {members: $in: ["fec7bc90-260e-41c4-bef1-1dbe695e082b"]}?"

I tried to follow the steps mentioned in the the thread How to make a user able to join a channel using the channel's ID with getstream-io but still I get the same error.

Could anyone provide further help to resolve this.

I tried to call queryChannels as below :

        const filter = { id: { $eq: 'someId' } }
        const channels = await chatClient.queryChannels(filter)

Expected to get the channel with the id, but instead got below error :

Uncaught (in promise) Error: StreamChat error code 70: QueryChannels failed with error: "1 channels match your query but cannot be returned because you don't have access to them. Did you forget to include {members: $in: ["fec7bc90-260e-41c4-bef1-1dbe695e082b"]}?"
0

There are 0 best solutions below