Adding app permission settings

  • 5
  • Idea
  • Updated 7 years ago
  • Implemented
The Android version of my app requests acces to several resources upon installation of the app (Location, messages, contactdetails, network status, SD-access and so on...).

With the PhoneGap SDK I can change these permissions myself, it would be nice if we can easily change these permissions in the App settings form (with checkboxes maybe?).
Photo of Pegtel

Pegtel

  • 7 Posts
  • 0 Reply Likes

Posted 10 years ago

  • 5
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Yes, this is something we will implement in the future.
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
Any news regarding this issue?
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Yes, we've added this support into our open source config generation project:
https://github.com/alunny/confetti/co...

Full integration with Build plus appropriate documentation will be up in the next couple of days.
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
How should the permission be configured?I haven't managed to get them working no matter what I put in the config.xml file.

Should the tags map straight into the Android permissions? Even if I put no features, the app still requires several. Or does PhoneGap itself always require certain permissions to work properly (even if you don't use the API)?
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
Here is one of mine that works

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.whitefox.parken"
version = "1.0.1">

<name>PARKEN 2011</name>

<description>
PARKEN 2011
</description>

<author href="http://www.whitefox.no"
email="simon@whitefox.no">
WhiteFox AS
</author>

<gap:platforms>
<gap:platform name="android" minVersion="2.2" />
<gap:platform name="ios" />
</gap:platforms>

<icon src="icon.png" gap:role="default" />

<gap:splash src="images/phonestartup.png"/>

<feature name="http://api.phonegap.com/1.0/geolocati...;
<feature name="http://api.phonegap.com/1.0/network"/&gt;

<!-- sample preference specification -->
<preference name="autorotate" value="false" readonly="true"/>
</widget>
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
Did some of your XML get cut out?
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
fixed
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
And it only asks for geolocation and networkin permissions?
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
I have a test app that has no feature tags, doesn't use the PhoneGap Javascript API, and it still requires these permissions:

- Your location
- Your personal information
- Network communication
- Storage
- Hardware controls
- Phone calls
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
Yes... it only asks for geolocation and networkin permissions.
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
This is mine that requires the permissions I listed above (edited to hide email):

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:gap="http://phonegap.com/ns/1.0"
id="fi.kpuputti.staticstartdemo"
version="0.0.7">

<name>Static Start Demo</name>

<description>
Mobile HTML5 test app
</description>

<author href="http://kpuputti.fi"
email="...">
Kimmo Puputti
</author>

<gap:platforms>
<gap:platform name="android" minVersion="2.2" />
</gap:platforms>

</widget>
Photo of Simon Flack

Simon Flack

  • 24 Posts
  • 0 Reply Likes
If you dont explicitly supply <feature ... > tags then the installer will assume you need all features.
Photo of Kimmo Puputti

Kimmo Puputti

  • 25 Posts
  • 0 Reply Likes
Well, almost. I added one feature:

<feature name="http://api.phonegap.com/1.0/network" />


and now it asks these permissions:

- Storage
- Network communication
- Phone calls

So are the 'Storage' and 'Phone calls' permission required by PhoneGap anyway and cannot be removed?
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
The READ_PHONE_STATE and INTERNET permissions are currently required by PhoneGap.

Not sure about the storage one - it may be a bug in our build packager. I will investigate.
Photo of Melinda 79

Melinda 79

  • 45 Posts
  • 0 Reply Likes
My app does not need any permission at all, YET by default "build.phonegap" writes a huge list of permission which hinders clients from install.
Here is a list of what a client gets:

Application Permissions:
•Write to external storage
•Access coarse (e.g., Cell-ID, Wi-Fi) location
•Access the list of accounts in the Accounts Service
•Read the user's contacts data
•Write (but not read) the user's contacts data
•Modify global audio settings
•Required to be able to access the camera device
•Record video
•Open network sockets
•Access fine (e.g., GPS) location
•Access extra location provider commands
•Access the vibration feature
•Record audio
•Access information about networks

How can make my app by default ask for NO PERMISSION AT ALL.???
THANKS :)