jefflinwood / twilio_client_phonegap

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

console.log(Twilio.Device.status()) returns undefined #18

Closed rinnungirenthlei closed 9 years ago

rinnungirenthlei commented 9 years ago

Hi, After device is ready, when i do console.log(Twilio.Device.status()) it returns undefined.

Is there is any change in syntax?

Also, after closing the app, when i reopen the app it does not run Twilio.Device.ready function. Please help me with the queries. Thanks.

jefflinwood commented 9 years ago

Hi,

Check the readme - because of PhoneGap limitations, this isn't 100% the same as the Javascript client SDK:

Methods that interrogate the client device or connection and return a result e.g. Twilio.Device.status() take a callback function with the response as the argument. Unfortunately I think this is unavoidable due to communication between the Phonegap JS and iOS layers being strictly asynchronous, e.g.