zaid
July 7, 2023, 1:10pm
1
const [channelId, setChannelId] = useState(DEFAULT_CHANNEL_ID);
const [overlay, setOverlay] = useState(true);
const newChannel = {
avatarFileId: ‘fileId’,
displayName: ‘Umair’,
tags: [‘tag’],
type: ‘conversation’,
userIds: [‘umair’],
metadata: {
data: ‘anything’,
},
};
const createChannelId = async () => {
try {
const channel = await ChannelRepository.createChannel(newChannel);
console.log('channel', channel)
console.log('channelID', channel.channelId)
} catch (error) {
console.log('error', error)
}
}
Hello, for ‘Conversation’ type - the channel ID for these channels will always be generated by the SDK , so you don’t have to assign any specific ID for these channels. Please refer to this section for more detail: Create Channel - Amity Docs
zaid
July 7, 2023, 1:52pm
3
it is not return me channel id when we create new channel
Are you using ts sdk? May I know your current sdk version pls?
zaid
July 7, 2023, 2:17pm
5
i am using this version
“@amityco /js-sdk”: “^5.36.0”,
Hello, may I confirm a few things,
When you create a conversation channel, does it return that it’s successfully created?
From the screenshot you have provided, it’s showing “channelId: undefined”, you received that when you tried to query the channel, is that correct?