Re: Network Information API

On Tuesday, January 21, 2014 at 1:01 AM, Mats Wichmann wrote:

> On 01/20/2014 05:52 PM, Mats Wichmann wrote:
> > On 01/20/2014 12:47 PM, Marcos Caceres wrote:
> > 
> > > When all you really wanted was "isCarrierNetwork"? There doesn't appear to be any value, at least in this application, in knowing if the connection is 2g, 3g, or 4g. 
> > > 
> > > It also shows how much cleaner this is with the new proposed API:
> > > 
> > > if (this.netInfo.connection === 'wifi') { return true; }
> > 
> > yes but even here we already have some cases where "it doesn't mean what
> > you think it means" if we're assuming wifi = good quality, unrestricted
> > usage is available: a mobile carrier-connected device is serving as a
> > hotspot to another device, which then sees 'wifi'.
> 
> 
> 
> sometimes I hate silly mail clients... I left that message sitting there
> intending to finish the thought, and only now noticed that somehow it
> got sent.


I thought it was a valid thought/concern :) I'm sure some devs will make that assumption.  
 
> Is there a way we can pick identifiers where the interpretation is left
> to the implementation, not to the app? If the implementation can
> determine that a connection has the properties matching a particular
> state it can report that, else say something conservative. This is NOT a
> proposal for the specific identifier names, rather an illustration: if
> the app is presented with connection == 'restricted' vs connection ==
> 'unrestricted', then it doesn't have to try to apply value judgements to
> what, for example == 'wifi' actually should mean, nor that the value
> placed is likely to change over time.


Again, I would be in favor of leaving what "wifi" and "cellular" mean to the user. They are the ones explicitly paying/connecting to each of those - so they are in the best position to know what they mean. 

Received on Tuesday, 21 January 2014 11:19:40 UTC