1

I was trying to add a TWILIO Chat in my Angular2 application. I got a solution for importing TWILIO into our component from this link - How to use Twilio Client in Angular 2? .

While consoling the Twilio variable, which i got from declare const Twilio: any;, i am getting the entire twilio function. Can anyone please tell me how can i actually implement a chat application or how can i make use of that function, in my application.

Veena K. Suresh
  • 942
  • 5
  • 16

1 Answers1

2

Twilio developer evangelist here.

Now that you have the Twilio variable, you can access the chat functions through the Twilio.Chat.Client object.

I recommend reading through the Twilio Programmable Chat documentation to see how it all works together and how you can build your own chat application. You can also check out the example application, which isn't built in Angular, but should give you an idea of how things should work together.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • what about Angular+NativeScript? ( https://stackoverflow.com/questions/56687363/using-twilio-chat-with-nativescript-and-angular ). I can't find any example out there. My guess was that it should have worked, it is JavaScript in the end, and I'm not using dom/browser/window stuff. `twilio-chat` works fine in Electron+Angular, but not on NativeScript+Angular. I really don't know what else I can try to make `twilio-chat` work. – MrCroft Jun 20 '19 at 15:04
  • I don't know much about NativeScript myself. From a cursory glance, I don't believe web sockets are supported out of the box and they are pretty fundamental to Chat, so I would look into that. I'm not aware of any examples out there though. – philnash Jun 23 '19 at 16:42