You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Jason Peterson <ja...@essenzasoftware.com> on 2015/04/08 19:17:40 UTC

[ios] cordova-plugin-geolocation ios8 permissions

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

Re: [ios] cordova-plugin-geolocation ios8 permissions

Posted by Carlos Santana <cs...@gmail.com>.
+1 much better UX

On Wed, Apr 8, 2015 at 2:07 PM, Jesse <pu...@gmail.com> wrote:

> +1
> Please file a bug in JIRA.
>
> @purplecabbage
> risingj.com
>
> On Wed, Apr 8, 2015 at 10:17 AM, Jason Peterson <jason@essenzasoftware.com
> >
> wrote:
>
> > 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
> >
>



-- 
Carlos Santana
<cs...@gmail.com>

Re: [ios] cordova-plugin-geolocation ios8 permissions

Posted by Jesse <pu...@gmail.com>.
+1
Please file a bug in JIRA.

@purplecabbage
risingj.com

On Wed, Apr 8, 2015 at 10:17 AM, Jason Peterson <ja...@essenzasoftware.com>
wrote:

> 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
>