You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(geolocation): correct handling of location permission on iOS (#163)
This was broken with the introduction of new location permission handling in iOS 13.4. Now it is possible to request "always" permission when "when use" permission is already granted. Also added function to monitor the location permission changes on iOS.
| getCurrentLocation(options: Options) | Promise<Location> | Get current location applying the specified options (if any). Since version 5.0 of the plugin, it will use [requestLocation](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620548-requestlocation?language=objc) API for devices using iOS 9.0+. In situation of poor or no GPS signal, but available Wi-Fi it will take 10 sec to return location. |
88
88
| watchLocation(successCallback: successCallbackType, errorCallback: errorCallbackType, options: Options) | number | Monitor for location change. |
89
+
| watchPermissionStatus(permissionCallback: permissionCallbackType, errorCallback: errorCallbackType)| number | Monitor for location permission change. Only on iOS!
89
90
| clearWatch(watchId: number) | void | Stop monitoring for location change. Parameter expected is the watchId returned from `watchLocation`. |
90
91
| enableLocationRequest(always?: boolean, openSettingsIfLocationHasBeenDenied?: boolean) | Promise\<void\> | Ask for permissions to use location services. On iOS when `always` is true, it opens a custom prompt message and the following keys are required: [NSLocationAlwaysAndWhenInUseUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nslocationalwaysandwheninuseusagedescription) (iOS 11.0+) OR [NSLocationAlwaysUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nslocationalwaysusagedescription?language=objc) (iOS 8.0-10.0) and [NSLocationWhenInUseUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nslocationwheninuseusagedescription). Read more about [request always usage](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620551-requestalwaysauthorization) On Android always (ACCESS_BACKGROUND_LOCATION) permission needs to be requeseted for SDK >= 29. Read about Android location permissions [here](https://developer.android.com/training/location/permissions). On Android SDK >= 29 the user gets prompted a system dialog with the option 'allow all the time' when the always option is selected [read more](https://developer.android.com/training/location/permissions#request-background-location) When `openSettingsIfLocationHasBeenDenied` is true and the permission has previously been denied then the settings app will open so the user can change the location services permission. |
91
92
| isEnabled | Promise\<boolean\> | Resolves `true` or `false` based on the location services availability. |
0 commit comments