Application permissions

BlackBerry 10 devices can capture rich information from their users' environments, such as location data (provided by the GPS receiver), images (taken using the camera), sounds (captured using the microphone), and other information that users might want to control access to. To protect against potentially malicious code, users must grant your application permission to access functionality that captures certain types of information.

You must specify the device functionality that your application requires by adding permissions to the bar-descriptor.xml file using the <permission> element.

If an application uses APIs that can access restricted functionality, but the application does not request permission to access that functionality, the application fails. When you build your app, make sure to test the behavior of your application for cases when permissions are denied.

Permissions

Feature Permission

Calendar

access_pimdomain_calendars

Allows this app to access the calendar, including viewing, adding, and deleting appointments.

Camera

use_camera

Allows this app to take pictures, record video, and use the camera's flash.

Contacts

access_pimdomain_contacts

Allows this app to access contacts, including viewing, creating, and deleting contacts.

Device information

read_device_identifying_information

Allows this app to access device identifiers such as the serial number and PIN.

Email and PIN messages

access_pimdomain_messages

Allows this app to access email and PIN messages, including viewing, creating, sending, and deleting messages.

GPS location

read_geolocation (BlackBerry 7.1 or earlier)

access_location_services (BlackBerry 10)

Allows this app to access the GPS location of the device.

Location information

access_location_services

Allows this app to access the device’s current or saved locations. This permission replaces read_geolocation, and includes access to location information from GPS, Wi-Fi, and cell ID.

Microphone

record_audio

Allows this app to record sound using the microphone.

Notebooks

access_pimdomain_notebooks

Allows this app to access notebooks, including adding and deleting entries and content.

Notifications

post_notifications

Allows this app to display a notification to the notification area of the screen.

Run in background

run_when_backgrounded

Allows this app to run in the background.

Use this feature sparingly and only when your application must perform processing in the background.

Shared files

access_shared

Allows this app to access pictures, music, documents, and other files stored on the device, at a remote storage provider, on a media card, or in the cloud.

Text messages

access_sms_mms

Allows this app to access text messages, including adding and deleting messages.

Specifying permissions

The following sample demonstrates how to set permissions to access text messages, read GPS location information, and access camera data. If a permission is not specified, the BlackBerry device user is not prompted to allow access, and your app cannot use that feature. 

<permissions>access_sms_mms</permissions>
<permissions>access_location_services</permissions>
<permissions>use_camera</permissions>
comments powered by Disqus