**I am trying to integrate sendbird desk sdk and sendbird chat sdk in my react native application **
I tried to create a ticket using Ticket.create method as provided in the documentation though I could see the user getting created in the desk dashboard I am not able to see. any the tickets added in the dashboard but in the response I am able to see ticket getting created
** “sendbird”: “^3.1.29”,
“sendbird-desk”: “^1.0.22”,**
[Reproduction Steps]
const sb = new SendBird({ appId: '036F9711-A5D5-4AD2-B7F2-797B6CEDA6A8' });
useEffect(()=>{
SendBirdDesk.init(SendBird);
SendBirdDesk.authenticate(userId, '', (user, error) => {
if (error) throw error;
console.log('sb.authenticate',user.token, typeof user)
setToken(user.token)
// SendBirdDesk is now initialized, and the customer is authenticated.
});
sb.connect(userId, token, (user, error) => {
if (error) {
// Handle error.
}
console.log('sb.currentUser',user, typeof user)
const customFields = {
'Product type': 'Desk',
'line': '3'
};
Ticket.create('123',userId,(ticket,err)=>{
console.log('test====',ticket.channelUrl,'test====channel', ticket.channel)
console.log('sb.currentUser',ticket, err)
ticket.channel.sendUserMessage(TEXT, (message, error) => {
if (!error) {
const message = message;
if (SendBirdDesk.Message.UrlRegExp.test(message.message)) {
const urlInMessage = SendBirdDesk.Message.UrlRegExp.exec(message.message)[0];
SendBirdDesk.Ticket.getUrlPreview(urlInMessage, (response, error) => {
if (error) throw error;
this.ticket.channel.updateUserMessage(
message.messageId,
message.message,
JSON.stringify({
type: SendBirdDesk.Message.DataType.URL_PREVIEW,
body: {
url: urlInMessage,
site_name: response.data.siteName,
title: response.data.title,
description: response.data.description,
image: response.data.image
}
}),
message.customType,
(response, error) => {
if (error) throw error;
this.updateMessage(response);
});
});
}
}
});
})
CRITICAL