Hello,
I am wondering why this getChannel
call keeps hanging, and doesn’t ever return. In a previous attempt, I added a time limit to the call, and it’d just end up failing when it should succeed.
I’m using Amity inside my Unity app, and we have members with teamId
that refers to the equivalent Amity channel channelId
.
Below is my code.
Note that: userModel.metadata.teamId
is a valid string referring to a real channel in our Amity Console, so I’m not sure why it’s failing:
const channelData = await new Promise ((resolve) =>
{
const searchingChannel = ChannelRepository.getChannel(userModel.metadata.teamId);
searchingChannel.once('dataUpdated', data =>
{
console.log("Searching channel was successful!");
resolve(data);
});
searchingChannel.once('dataError', error =>
{
console.log("Searching channel failed: " + JSON.stringify(error));
reject(error);
});
}).catch((error) =>
{
console.log("Searching channel was unsuccessful: " + JSON.stringify(error));
return null;
});
If you need, I can provide the details as to what teamId
refers to, and verify that it’s an existing valid channel in my Amity Console.