jefflinwood / twilio_client_phonegap

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

Twilio Connection object parameters #9

Closed irregularprofit closed 9 years ago

irregularprofit commented 9 years ago

Hi Jeff.

First of all I would like to say this is a great project. It's already save me loads of time, and probably a great many head aches to come.

I am currently trying to receive calls from Twilio on my phonegap project. And according to https://www.twilio.com/docs/client/connection#parameters, the connection object should contain both status and parameters.

I can see the status value just fine. However, attempting to access the parameters field, I am getting a undefined response. Is this a factor of the phonegap plugin that hasn't been implemented? Or might I be doing something commonly wrong?

This is the pertinent part of the code

Twilio.Device.incoming(function(conn) {
   conn.status(function(status) { alert(status) });
   alert(conn.parameters);
   alert(conn.parameters.From);
   alert(conn.parameters.To);
   ...
jefflinwood commented 9 years ago

Hi,

It's nothing you are doing wrong - it's just a feature of the Twilio Client SDK that hasn't been implemented yet in the PhoneGap plugin.

It should be pretty straightforward to add it, I don't see any road blocks or reasons it couldn't be done. I'll try and get to this shortly.

Thanks! Jeff

jefflinwood commented 9 years ago

Quick Update, I've got the iOS version coded up, now I just need to create a sample application that uses connection parameters, then I'll do the Android version.

irregularprofit commented 9 years ago

That's awesome.

New to Objective-C so I am looking forward to seeing the completed code, whether or not it confirms what I think has to be the necessary changes.

To update this, would I just need to copy the updated files into my xcode project again? Or should I uninstall through plugman and reinstall again?

jefflinwood commented 9 years ago

You can just copy the updated files into your project.

jefflinwood commented 9 years ago

Hi,

Check out the updates to the code in the most recent commits, and if this solves your problem, feel free to close this issue - otherwise, let me know what you need.

Thanks! Jeff

peder541 commented 9 years ago

From a quick glance it appears that parameters has been implemented asynchronously. So the form would be:

conn.parameters(function(parameters) {
    alert(parameters.From);
});

Is that correct, Jeff?

jefflinwood commented 9 years ago

Yes, that's correct! It's similar to connection status.

Jeff

On Wednesday, September 3, 2014, Ben Pedersen notifications@github.com wrote:

From a quick glance it appears that parameters has been implemented asynchronously. So the form would be:

conn.parameters(function(parameters) { alert(parameters.From);});

Is that correct, Jeff?

— Reply to this email directly or view it on GitHub https://github.com/jefflinwood/twilio_client_phonegap/issues/9#issuecomment-54358124 .

irregularprofit commented 9 years ago

Awesome. I have access to the parameters field now.