Can anyone please guide me how do I integrate/require twilio.js file in the my application? I have to do it with angular.js
app. I can't require/include it and can't get the Twilio
object to call it's methods. I'm really new to it!
By just adding following script tag do not makes me able to use Twilio
object:
<script type="text/javascript" src="//media.twiliocdn.com/sdk/js/client/v1.4/twilio.js"></script>
Results:
Update:
As per @philnash help I've resolved the previous error and now this is how my code looks like is:
<script type="text/javascript" src="//media.twiliocdn.com/sdk/js/client/v1.4/twilio.js"></script>
<script>
Twilio.Device.setup(@token, { debug: true, region: "ie1" });
Twilio.Device.ready(function(device) {
// The device is now ready
alert("Twilio.Device is now ready for connections");
});
</script>
But I'm getting the below error:
Any help will be appreciated!