jefflinwood / twilio_client_phonegap

Phonegap plugins for the Twilio Client iOS and Android SDKs
MIT License
59 stars 53 forks source link

Import into Ionic 3 Application #87

Open aaka3207 opened 6 years ago

aaka3207 commented 6 years ago

I can't seem to import the plugin into an Ionic 3 application. When I try to access cordova.plugins it doesn't show up. I've tried all of the following with no luck:

import * as Twilio from "twilio-client-phonegap-plugin/www/tcPlugin"

declare var Twilio:any;

this.twilio = cordova.require("com.phonegap.plugins.twilioclient");

ishan123456789 commented 6 years ago

A possible solution for twilio undefined in my case was that I took the tcPlugin.js and placed it inside my assets folder and then imported it like this <script src="assets/twilio.js"></script> index.html and then using declare var Twilio:any; fixed it. #86