jefflinwood / twilio_client_phonegap

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

Connection Status #13

Open kalitk0 opened 9 years ago

kalitk0 commented 9 years ago

Hi,

I am using this plugin and it work great, however I cannot figure it out how to get the connection status on status change.

Any help will be appreciated.

jefflinwood commented 9 years ago

Hi,

You can register handlers for disconnect and accept that get called back when the connection status changes - there isn't a connection status listener.

For instance, connection.disconnect(function() { doSomething();});

That's different from calling connection.disconnect() with no arguments - that will disconnect the connection.

peder541 commented 9 years ago

There is also Twilio.Device.connect(function() { doSomething(); }) which is basically the opposite of connection.disconnect(function() { doSomething(); })

https://www.twilio.com/docs/client/device#connect-handler