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
nabeelkc
Posts: 7
Registered: ‎09-10-2013
My Device: Blackberry 6 Torch 9800
My Carrier: Airtel

How to show GPS Location permission request prompt as popup in Z10 device on App launch?

[ Edited ]

Hi,

 

 

I have a blackberry application developed using jQuery Mobile and wrapped in Phone Gap. It contains some map features. For that, the client needs to prompt for GPS Location permission request on App launch. 

I have the following codes in my config.xml:

 

<rim: permissions>
<rim: permit>read_geolocation</rim: permit>
<rim: permit>access_location_services</rim: permit>
</rim: permissions>

 

Blackberry6 device asks for permission but Blackberry Z10 device does not prompt. I would like to have a popup prompt asking for such permission.

The device I am testing on is Blackberry Dev Alpha B.

 

Can any one please give me a suggestion for this?

 

Thanks in advance.

 

Nabeel.

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to show GPS Location permission request prompt as popup in Z10 device on App launch?

Hi there, that should be enough to get the prompt to come up on BlackBerry 10. Specifically, BlackBerry 10 relies on the access_location_services permission.
https://developer.blackberry.com/html5/apis/navigator.geolocation.html

Can you please confirm your full OS version that you are testing on? I recall earlier versions had some conflict between the legacy and BB10 way of doing things.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
New Contributor
nabeelkc
Posts: 7
Registered: ‎09-10-2013
My Device: Blackberry 6 Torch 9800
My Carrier: Airtel

Re: How to show GPS Location permission request prompt as popup in Z10 device on App launch?

Hi,

 

Thanks for your reply.

 

The device OS version I am testing on is 10.2.0.1047

Model number: STL100-1

 

 

Thanks.

Nabeel

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to show GPS Location permission request prompt as popup in Z10 device on App launch?

I would wager that OS is updated / has the fix and should be showing the prompt.

Can you please navigate into your system Settings and confirm which application permissions have been granted / denied for the application you are testing?

Also, if you completely uninstall the application and re-install it, does the prompt get displayed then?

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: How to show GPS Location permission request prompt as popup in Z10 device on App launch?

Can I suggest interrogating the have_permission API

 

There are lots of required fallbacks and this is one

 

Erik - A diagram would help here - cause -> effect




Click the like button if you find my posts useful!
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to show GPS Location permission request prompt as popup in Z10 device on App launch?

Good call peardox. I'm not overtly familiar with the hasPermission API but it seems we can use it to check for various <feature> elements and ensure they've been included:
http://developer.blackberry.com/html5/apis/blackberry.system.html#.hasPermission

I don't believe this would provide detail about <rim:smileytongue:ermit> elements though. In this case, both look to be in order, but it's worth checking. As noted, I don't have a lot of familiarity with the API, but will check with some colleagues. Feel free to add any insight.

I'm not exactly sure which sort of diagram you are referring to peardox.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.