Permissions

The permissions element is used to declare all permissions that are necessary for the project, using one permission element per permission. It is possible to add conditions to these elements.

<permissions>
   <permission name="INTERNET"/>
   <permission name="SEND_SMS"/>
</permissions>

NeoMAD uses the permissions declared in the URS file to automatically add the corresponding permissions in the right file depending on the platform:

  • Android: AndroidManifest.xml
  • iOS: project Info.plist
  • Windows Phone: WMAppManifest.xml
  • Windows Store App: Package.appxmanifest

Please refer to the Generic API’s JavaDoc to know when a permission is required to use a specific feature.

Table of permissions

AGENDA Allows an application to access the user’s calendar
CAMERA Allows an application to launch Camera
DEVICE_STATE Allows an application to read some information about device
EXTERNAL_STORAGE Allows an application to read-write files inside external storage space
FILE Allows an application to read-write files
GET_ACCOUNTS Allows an application to access to the list of accounts (Facebook, Google)
INTERNET Allows an application to access the Internet (HTTP requests)
LOCAL_NOTIFICATION Allows an application to broadcast-schedule local notification to the user
LOCATION Allows an application to start Location and access location information
LOCATION_PROXIMITY Allows an application to be notified about proximity location events
NETWORK_STATE Allows an application to know Network state (connected, disconnected…)
PHONE_CALL Allows an application to initiate a phone call
PHOTO_LIBRARY Allows an application to access the user’s photo library
READ_CONTACTS Allows an application to read Contacts from the user address book
SEND_SMS Allows an application to initiate a SMS message
SENSORS Allows an application to read sensors information (accelerometer…)
VIBRATE Allows an application to initiate a device vibration
WEB_VIEW Allows an application to use WebView control and displays web content
WRITE_CONTACTS Allows an application to write contacts or modify them

Permission usage descriptions

In iOS platform, a description is needed in order to say to the end-user why the application needs the permission.

A popup will be displayed by the iOS system in order to ask to the user if he is agree to grant permission and the description will be displayed inside the popup. If the application uses an API that requires a permission but no description is provided, the application will exit. These descriptions should be provided through ``res/string/infos-<LOCALE>.xml``file (instead of URS file) in order to be localized.

List of keys from the res/string/infos.xml file needed by iOS in order to say why the application needs the permission (descriptions are localized):

AGENDA agendaPermissionUsage
CAMERA cameraPermissionUsage and microphonePermissionUsage
LOCATION locationWhenInUsePermissionUsage or locationAlwaysPermissionUsage
PHOTO_LIBRARY photoLibraryPermissionUsage
READ_CONTACTS contactsPermissionUsage
SENSORS sensorsPermissionUsage

For further details see info resource documentation.

Note

If permission usage description is declared without the corresponding URS permission declaration (or vice-versa), NeoMAD will print a warning.