UNPKG

1.36 kBMarkdownView Raw
1<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/src/@ionic-native/plugins/geolocation/index.ts#L104">
2 Improve this doc
3</a>
4
5# Geolocation
6
7```
8$ ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"
9$ npm install @ionic-native/geolocation
10```
11
12## [Usage Documentation](https://ionicframework.com/docs/native/geolocation/)
13
14Plugin Repo: [https://github.com/apache/cordova-plugin-geolocation](https://github.com/apache/cordova-plugin-geolocation)
15
16This plugin provides information about the device's location, such as latitude and longitude. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs.
17
18 This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation.
19
20For iOS you have to add this configuration to your configuration.xml file
21```xml
22<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
23 <string>We use your location for full functionality of certain app features.</string>
24</edit-config>
25```
26
27## Supported platforms
28
29- Amazon Fire OS
30 - Android
31 - Browser
32 - iOS
33 - Windows
34
35
36