Get some information from phone

Hi,

I want to access phone information. Can I get phone name info? Is it possible?

Hi Onur,

We unfortunately don’t have much of that type of information exposed in a cross platform way yet. However, you can always access the full API of your device through foreign code.

If this will be done in the future here’s an API suggestion: just provide an object with getter properties that return a promise:

var phone = require('FuseJS/Phone');
phone.name.then(function(name) {
  console.log(name); // where name is the name of the phone
});

As you can see phone.name returns a promise that will read the phone name and when its done reading it would return the resolved value

At least with read only properties, so no need for:

phone.getName(); // value
phone.setName(); // set name (no need we shouldn't be able to set the name right?)

Or perhaps methods are better:

phone.getName().then(function(name) {
  console.log(name); // where name is the name of the phone
});

I see no reason of having them as function calls unless there are paramters that will be passed, but since I can’t think of none perhaps its better?

Point is please return promises but just some ideas above :slight_smile:

Thanks for feedback.