I have a Twilio channel and I'm trying to get its invited users, but I'm not sure how to do this:
let messagingClient = this.state.messagingClient;
messagingClient.getUserChannelDescriptors().then(channels => {
let channelsHash = {};
channels.items.map(channelDescriptor => {
var channel = channelDescriptor.getChannel().then((channel) => {
channelsHash[channel.uniqueName] = channel;
console.log(channel.getInvited()) // print invited users
});
});
What would I replace the channel.getInvited()
by? It seems like Twilio channels do indeed have such a property, as there is an invited resource here: https://www.twilio.com/docs/api/chat/rest/invites#action-list
Twilio developer evangelist here.
I'm afraid that right now the JavaScript SDK does not have a method to retrieve the invited users. In order to get this functionality right now, you will need to use the REST API.
Getting invited users from the SDK is on the backlog though, so keep an eye on the library releases.
Edit
Using the REST API to get the invited members: