cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Peterson <ja...@essenzasoftware.com>
Subject [ios] cordova-plugin-geolocation ios8 permissions
Date Wed, 08 Apr 2015 17:17:40 GMT
Hello,

If this is not the correct list to start this discussion, please let me
know.

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:

        if([[NSBundle mainBundle]
objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"])
{
            [self.locationManager  requestWhenInUseAuthorization];
        } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@
"NSLocationAlwaysUsageDescription"]){
            [self.locationManager requestAlwaysAuthorization];

I have a use case where an app launches with both descriptions set, but
depending on client configuration the AlwaysInUse 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.

Thanks,

Jason

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message