javascriptwindows-8windows-store-apps

How can a Windows 8 Store app (Javascript) open Permissions pane programmatically?


I know that we can programmatically open an app's Settings pane by

Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView().show()

and app created setting panes by using the WinJS library.

Is it possible to directly open a system setting pane like the Permissions (or Rate and Review) setting pane programmatically?

MSDN's Guidelines for devices that access personal data says (in Other guidelines for revocation messages):

  • Don't programmatically try to launch the Permissions page in the Settings charm

But I couldn't find a way to do that. I want users to be able to click a button in app which directly opens Permissions setting pane.

Update (24 April, 2013): Found this in Programming Windows 8 Apps with HTML, CSS, and JavaScript book pp. 341 (Chapter 8: State, Settings, Files, and Documents -> Settings Pane and UI -> Programmatically Invoking Settings Flyouts) from Microsoft Press:

Note While it’s possible to programmatically invoke your own settings panes, you cannot do so withsystem-provided commands like Permissions and Rate and Review. If you have a condition for whichyou need the user to change a permission, such as enabling geolocation, the recommendation is todisplay an error message that instructs the user to do so.

This statement is at odds with the MSDN document. I still don't know which one is true.


Solution

  • The statement above says you can provide your own SETTINGS panes (such as with .showSettings()) , this doesn't mention that you can do this for Permissions - which you cannot.

    The statements aren't at odds with each other, one says 'dont launch permissions pane' and the other says 'You can control your own settings'

    Permissions aren't your own app settings, they are controlled by the user's permissions and the OS.