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

Native Development

Reply
Developer
sgallego84
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -
Accepted Solution

Application permissions

Hi all,

 

is there any way to check if the user has given permissions to the current app for any of the app bar-descriptor.xml permissions added???

If it is possible, is there any way to open the 'Application Permissions' (Settings/Security and privacy/Application Permission) screen from the app? 

 

For example, I  add GPS permission to the app. When the user install the apps, he unchecks the GPS permission so the app can't get his location. I want to inform the user it is needed to use GPS location and prompt the user to open the permissions screen.

 

Thanks!

Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Application permissions

[ Edited ]

A small number of the permissions can be read through a supplied class associated with that service, however the majority, including GPS, will return some kind of PERMISSION_DENIED error when trying to access.

 

http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.do... 

 

I think the one you should be looking for is

 

GEOLOCATION_ERROR_FATAL_DISABLED

 

http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_re...

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Application permissions

As well, for the question about Settings, you can use invocation to open the Application Permissions page, though not at the page for your own app (yet): https://developer.blackberry.com/cascades/documentation/device_platform/invocation/settings.html


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Application permissions

Thanks Peter, I didn't realise this was possible.

 

So in essence on detecting that the permission is not set you can inform the user as such then take them to this page to set it.

Much more user-friendly than just giving an error message saying 'Your location permission has not been set'.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.