Closed kwallis closed 11 years ago
perhaps an actual event when type changes would be just as useful, applications might want to warn the user that they are now not on Wifi etc.. if they are streaming music or videos.
w3c or cordova both do not have anything like this, but it seems useful to me. @kwallis - let me know what you think.
There is a technical difficulty in following the Cordova API (i.e. making that information available in blackberry.connection.type property).
The expected behavior is supposed to be: whenever the field is accessed, a call will be made to the native side to find out what's the current active connection interface, correct?
But since in BB10 we are building the blackberry object on page load, all the values of the properties will be cached once it's loaded, i.e. once the page is loaded, the connection type value that gets returned will always be that cached value. Unless it is ok to return the cached value, otherwise this information must be returned via a function, not a property.
Can we use something like defineGetter to run a function when the property is accessed?
Problem solved: http://ejohn.org/blog/ecmascript-5-objects-and-properties/
Acceptance Criteria