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
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,16 @@ Apple requires privacy descriptions to be specified in `Info.plist` for location
16
16
-`NSLocationAlwaysAndWhenInUseUsageDescription` (`Privacy - Location Always and When In Use Usage Description`)
17
17
-`NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`)
18
18
19
-
> [!NOTE]
20
-
> This Capacitor plugin does not support background geolocation directly. However, it relies on
21
-
> [`ion-ios-geolocation`](https://github.com/ionic-team/ion-ios-geolocation), which can report
22
-
> location in the background. As a result, Apple requires you to include a
23
-
> `NSLocationAlwaysAndWhenInUseUsageDescription` entry in your `Info.plist`. Since this permission
24
-
> prompt won’t appear to users, you can safely use the same description string as for
25
-
> `NSLocationWhenInUseUsageDescription`.
19
+
:::info[Background Location Usage Strings]
20
+
21
+
This Capacitor plugin does not support background geolocation directly. However, it relies on
22
+
[`ion-ios-geolocation`](https://github.com/ionic-team/ion-ios-geolocation), which can report
23
+
location in the background. As a result, Apple requires you to include a
24
+
`NSLocationAlwaysAndWhenInUseUsageDescription` entry in your `Info.plist`. Since this permission
25
+
prompt won’t appear to users, you can safely use the same description string as for
26
+
`NSLocationWhenInUseUsageDescription`.
27
+
28
+
:::info
26
29
27
30
Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode
28
31
@@ -39,6 +42,12 @@ This plugin requires the following permissions be added to your `AndroidManifest
39
42
40
43
The first two permissions ask for location data, both fine and coarse, and the last line is optional but necessary if your app _requires_ GPS to function. You may leave it out, though keep in mind that this may mean your app is installed on devices lacking GPS hardware.
41
44
45
+
:::note
46
+
47
+
If you only require approximate location (variable accuracy but usually around 2 kilometers), you may just declare `ACCESS_COARSE_LOCATION` and `<uses-feature`, and use `enableHighAccuracy=false` when requesting location
48
+
49
+
:::note
50
+
42
51
Read about [Setting Permissions](https://capacitorjs.com/docs/android/configuration#setting-permissions) in the [Android Guide](https://capacitorjs.com/docs/android) for more information on setting Android permissions.
43
52
44
53
@@ -247,3 +256,4 @@ The following table list all the plugin errors:
247
256
| OS-PLUG-GLOC-0015 | Android | Google Play Services error. |
| OS-PLUG-GLOC-0017 | Android | Unable to retrieve location because device has both Network and Location turned off. |
259
+
| OS-PLUG-GLOC-0018 | Android | Location permissions are not declared in manifest. Make sure at least ACCESS_COARSE_LOCATION is declared in AndroidManifest.xml, and optionally ACCESS_FINE_LOCATION if you require precise location access. |
message ="Location permissions are not declared in manifest. Make sure at least ACCESS_COARSE_LOCATION is declared in AndroidManifest.xml, and optionally ACCESS_FINE_LOCATION if you require precise location access."
0 commit comments