You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1004 B

  1. # Getting Started with Geolocator Plugin
  2. ### API Usage
  3. Call **CrossGeolocator.Current** from any project or PCL to gain access to APIs.
  4. ```
  5. var locator = CrossGeolocator.Current;
  6. locator.DesiredAccuracy = 50;
  7. var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000);
  8. Console.WriteLine ("Position Status: {0}", position.Timestamp);
  9. Console.WriteLine ("Position Latitude: {0}", position.Latitude);
  10. Console.WriteLine ("Position Longitude: {0}", position.Longitude);
  11. ```
  12. ### **IMPORTANT**
  13. Android:
  14. You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission
  15. iOS:
  16. In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist.
  17. See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8
  18. Windows Phone:
  19. You must set the ID_CAP_LOCATION permission.