cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-8826) cordova-plugin-geolocation should reverse permissions request in ios8
Date Wed, 22 Jul 2015 19:53:04 GMT


ASF GitHub Bot commented on CB-8826:

GitHub user msokk opened a pull request:

    CB-8826 [iOS 8+] Request WhenInUse permission before Always permission

    First reported here:
    Currently the plugin asks for background location first if `NSLocationAlwaysUsageDescription`
is in place along with `NSLocationWhenInUseUsageDescription`. Given the current plugin functionality,
this is unnecessary and privacy wise disturbing to user.
    Apple documentation:
    > Requesting “Always” authorization is discouraged because of the potential negative
impacts to user privacy. You should request this level of authorization only when doing so
offers a genuine benefit to the user.
    This commit allows other plugins to request background permission separately.

You can merge this pull request into a Git repository by running:

    $ git pull CB-8826

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #46
commit 8e7ff11b9a97e923c16eb1b8edbb4eeca9eabe13
Author: Mihkel Sokk <>
Date:   2015-07-22T19:16:43Z

    CB-8826 Check for NSLocationWhenInUseUsageDescription first


> cordova-plugin-geolocation should reverse permissions request in ios8
> ---------------------------------------------------------------------
>                 Key: CB-8826
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Geolocation
>    Affects Versions: 3.4.0
>         Environment: iOS
>            Reporter: Jason Peterson
>            Priority: Minor
>              Labels: easyfix
>             Fix For: Master
> I would like to suggest a change to how the geolocation plugin requests
> permissions in iOS8.  In the event that both iOS8 NSLocation usage
> permissions exist, I suggest that we first request the least permissive one
> (NSLocationWhenInUseUsageDescription).
> This should amount to simply reversing the logic in CDVLocation.m:
> {code}
> if([[NSBundle mainBundle]
> objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"])
> {
>             [self.locationManager  requestWhenInUseAuthorization];
> } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@
> "NSLocationAlwaysUsageDescription"]) {
>             [self.locationManager requestAlwaysAuthorization];
> }
> {code}
> I have a use case where an app launches with both descriptions set, but
> depending on client configuration the "AlwaysInUse" permission may not be necessary.
 As the logic is written now, the plugin will always request that one, which could look a
bit extreme to the end user.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message