Access app permissions using QML and ArcGIS App Studio

880
5
Jump to solution
10-23-2018 01:34 PM
AdhikariBishrant
New Contributor II

Hello all, is there a way to access app permissions model using QML and ArcGIS App Studio ? The scenario is to open permissions dialog based on whether they "Allowed" or "Didn't Allow" the app to access certain function lets say Location services. 

I looked at a couple of ESRI's template apps and they also just get stuck if the user didn't allow location access in the first place. I was wondering if its even possible at this time. 

Any pointers would be appreciated.

Thanks in advance.

-Bishrant

0 Kudos
1 Solution

Accepted Solutions
ErwinSoekianto
Esri Regular Contributor

Bishrant, 

There is no way to enable that from the code, for security reason, the end-user need to agree to enable it. 

So for example for location service, let's say the location service is disabled earlier, and if we do the checkCapability and know that the location service is disabled, then you can initialize the PositionSource component (again), then it would open the popup to ask the user whether to allow the Location Service or not. 

Thank you,

Erwin

View solution in original post

0 Kudos
5 Replies
by Anonymous User
Not applicable

Hi.

You might want to check out this post for similar discussions:

Forcing Android permissions 

Shobana Suresh‌ had mentioned in there: "In a future AppStudio release, we are planning to add support in AppFramework to query if a capability has been enabled and accepted by the user "

I'm not sure whether these have been added yet, but if/when they are, this is possibly what you are looking for?

cheers,

-Paul

AdhikariBishrant
New Contributor II

Thanks for the pointer Paul Haakma, I read your's and Sobana's coversation on that thread, then Erwin Soekianto‌ highlighted the checkCapability method in new AppFramework. Although its not complete and can only check if the permissions exists (I cannot figure out if they have a way to open up native settings app), its a good starting point for me at this moment. But, the link that you shared definitely provided some ways of improving user experience if the users deny permissions.

Cheers,

-Bishrant

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Bishrant, 

We have added a method to check the app's capabilities including the location service in our AppStudio AppFramework during the release of version 3.1, using "checkCapability" method described in this doc, AppFramework QML Type | ArcGIS  

If you want to see how this is being used, you can take a look at the latest AppStudio Player, in the side menu for scanning QR code. And the source code of the AppStudio Player can be downloaded via AppStudio Desktop - Enterprise template. 

Thank you,

Erwin

0 Kudos
AdhikariBishrant
New Contributor II

Thanks Erwin,

that was kind of what I was expecting. One more thing, is there a way to open up the native settings application from QML or AppFramework ? (i.e. when the permissions were denied earlier).

Cheers,

-Bishrant

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Bishrant, 

There is no way to enable that from the code, for security reason, the end-user need to agree to enable it. 

So for example for location service, let's say the location service is disabled earlier, and if we do the checkCapability and know that the location service is disabled, then you can initialize the PositionSource component (again), then it would open the popup to ask the user whether to allow the Location Service or not. 

Thank you,

Erwin

0 Kudos