Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Managing Platform Services 2.0 permissions prompts

From Wiki
Jump to: navigation, search

This article explains how to manage permission prompts, when using Platform Services 2.0 APIs

Article Metadata
Tested with
Devices(s): Nokia C7-00
Platform(s): WRT 7.3
Device(s): WRT 7.3 (Browser 7.3) onwards
Keywords: getServicePermissions
Created: isalento (28 Feb 2012)
Last edited: hamishwillee (05 Jul 2012)


Security prompts are necessary to keep end user on control of what the Widget can do or not. However, if widget uses many Platform Services (PS) APIs, user experience degrades, as user has to grant permission for each API separately. Platform Services 1.0 offers an API to group these requests into one prompt: device.getServicePermissions(serviceSignatureObject);

When using Platform Services 2.0, it is not always clear what APIs you need to request access to, in order to make your widget to work without additional permission queries. One PS 2.0 API can use multiple PS1.0 APIs under the hood, to provide more complete interface to developer. One undocumented service provider, that PS 2.0 uses internally, is ServiceRegistry. You don’t have to worry about details of this API, other than its signature. Signature consists of service provide name and interface name.


This signature needs always to be included in service signature object, which is passed to getServicePermissions() method. Rest of the service signatures depends on what PS 2.0 APIs are used. Those can be found, by looking at platformservices.js file . For example PS 2.0 Camera API uses System information API, for getting camera properties and MediaManagement API to fetch captured image. Then we need access to following providers:

//check that device & getServicePermissions exist for backward comptibility	
if(device && typeof device.getServicePermissions == "function"){
try {
"Service.MediaManagement": "IDataSource"
catch (e) {
//notify the user that access to services has been declined
//continue by using old per service permission model

Following list has the signatures needed in addition to "Service.ServiceRegistry":"IService" to make PS 2.0 API to work, without additional prompts.

  • Camera API:
    • "Service.SysInfo":"ISysInfo"
    • "Service.MediaManagement": "IDataSource"
  • Calendar API :
    • "Service.Calendar”: "IDataSource"
  • Communications Log API:
    • 'Service.Logging',:'IDataSource'
  • Contacts API:
    • "Service.Contact": "IDataSource"
  • Landmarks API:
    • "Service.Landmarks": "IDataSource"
  • Location API:
    • "Service.Location": "ILocation"
  • Media Management API:
    • "Service.MediaManagement": "IDataSource"
  • Messaging API:
    • "Service.Messaging": "IMessaging"
  • Sensors API:
    • 'Service.Sensor': 'ISensor'
  • System Information API
    • 'Service.SysInfo': 'ISysInfo'
This page was last modified on 5 July 2012, at 02:41.
23 page views in the last 30 days.