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 Developer
Posts: 9
Registered: ‎11-24-2008
My Device: Not Specified

Check to see if javascript location services are enabled?

Hi,

 

Is there anyway to check (in javascript) if a Blackberry has location services on the device (ie the device is GPS enabled) and that the user has set the option to allow javascript location services?

 

I ask because I know some devices don't even have GPS capabilities and yet the JavaScript location api is availible on them. This makes is confusing, as this gives us seemingly no way to hide links to GPS based functionality on devices which don't support it / don't have it enabled.

BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Check to see if javascript location services are enabled?

You can use blackberry.location.GPSSupported to see if the location based services JavaScript APIs are available.

 

These can be available on BlackBerry devices without native GPS support if the user has paired their BlackBerry handheld with a Bluetooth GPS puck, which could provide the GPS information.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 9
Registered: ‎11-24-2008
My Device: Not Specified

Re: Check to see if javascript location services are enabled?


MSohm wrote:

You can use blackberry.location.GPSSupported to see if the location based services JavaScript APIs are available.

 

These can be available on BlackBerry devices without native GPS support if the user has paired their BlackBerry handheld with a Bluetooth GPS puck, which could provide the GPS information.


The blackberry.location.GPSSupported seems to be returning true on a model that doesn't have GPS support or a Bluetooth GPS puck.

BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Check to see if javascript location services are enabled?

What BlackBerry model and handheld software version are you testing on?  This can be found under Options, About on the BlackBerry handheld.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker