Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
gautaml
Posts: 2
Registered: ‎12-19-2012
My Device: Black Berry 10
Accepted Solution

hasDataCoverage undefined

I am trying to determine if the device has connectivity to the internet (either to Wifi or a data network e.g. 3g)

 

However blackberry.system.hasDataCoverage is undefined

 

Development environment:

WebWorks 1.0.2.9

BB10 Dev Alpha B 10.0.9 Bundle 388

 

What is the correct way to check, without actually making a network request?

Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 202
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3

Re: hasDataCoverage undefined

Try using blackberry.connection instead:

 

blackberry.connection.type !== blackberry.connection.NONE

 

I'll look into hasDataCoverage. I suspect the docs are not correct for BB10.

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
BlackBerry Development Advisor
bryanhiggins
Posts: 202
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3

Re: hasDataCoverage undefined

The docs are correct - this function is only available on BBOS and PlayBook

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Please use plain text.
BlackBerry Development Advisor
Nukul
Posts: 115
Registered: ‎06-06-2011
My Device: 9800

Re: hasDataCoverage undefined

please use

navigator.online
@nukulb
Please use plain text.
New Contributor
gautaml
Posts: 2
Registered: ‎12-19-2012
My Device: Black Berry 10

Re: hasDataCoverage undefined

It's actually navigator.onLine (capital L)

 

But yes this works.  

 

Thanks!

Please use plain text.
Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,

Re: hasDataCoverage undefined

There is a problem with the docs because the main code example for blackberry.system is

if (!blackberry.system.hasDataCoverage()) {
       alert("You are not in coverage, we will attempt to send later");
--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.
Developer
bert2002
Posts: 172
Registered: ‎05-01-2010
My Device: Z10

Re: hasDataCoverage undefined


interfaSys wrote:

There is a problem with the docs because the main code example for blackberry.system is

if (!blackberry.system.hasDataCoverage()) {
       alert("You are not in coverage, we will attempt to send later");

and its still wrong in the docs. It would be much appreciated if this will be fixed :Beta1:



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
Please use plain text.
Contributor
arnoldc
Posts: 35
Registered: ‎08-29-2012
My Device: Blackberry 10 Alpha Device

Re: hasDataCoverage undefined


bert2002 wrote:

interfaSys wrote:

There is a problem with the docs because the main code example for blackberry.system is

if (!blackberry.system.hasDataCoverage()) {
       alert("You are not in coverage, we will attempt to send later");

and its still wrong in the docs. It would be much appreciated if this will be fixed :Beta1:


Yea, please fix the API doc.

Please use plain text.