0

In my Package.appxmanifest I have declared broadFileSystemAccess capability.

In the code I have a try...catch statement for testing state of the File access toggle:

try
{
    var app1Folder = await StorageFolder.GetFolderFromPathAsync(@"C:\Users\krist\AppData\Local\Packages\9db24c29-1e69-4305-b62a-bcff344d6d41_915j3m6y7acyw");
}
catch (Exception ex)
{
    // prompt user for what action they should do then launch below
    // suggestion could be a message prompt
    var success = await Launcher.LaunchUriAsync(new Uri("ms-settings:appsfeatures-app"));
}

In the blog post that concerns this broadFileSystemAccess it is stated:

Just like other privacy issues, the app will trigger a user-consent prompt on first use.

What I have tested and seen, there is no user-consent prompt at all. Every article or SO answer states that I need to navigate to the Settings (or App settings) page of the app where the user needs to toggle "File system" switch.

However, from user perspective it would be convenient to answer simple "Yes/No" dialog and give that permission right from the app and continue execution with the new setting.

Is there any way how to trigger that user-consent dialog?

krs
  • 543
  • 2
  • 17

1 Answers1

0

Is there any way how to trigger that user-consent dialog?

No, it doesn't appear since the October 2018 release of Windows 10. What you should do since then is to prompt the user to change the setting himself/herself in the Setting app, just like you are currently doing.

Please refer to Andrew Whitechapel's answer here for more information.

mm8
  • 163,881
  • 10
  • 57
  • 88
  • Just a small note here regarding navigating user to the Settings: IMO it is more beneficial for the User (and in the end for the app developer too) to navigate him to exact App Settings page ("ms-settings:appsfeatures-app") and not the general one ("ms-settings:privacy-broadfilesystemaccess"). On the App Settings page it is easier for User to hit the "right" switch. Not sure if there's any impact on the Store submission process with regards to that. – krs Jul 16 '21 at 09:31
  • 1
    I doubt it will have any effect on the Store submission process. It's just another URI after all. – mm8 Jul 16 '21 at 11:44