Core concepts of the LocationManager API
v3.xThe plugin's API is modeled after Apple's CLLocationManager.
Key architectural details:
- Namespace: Since version 2, the plugin no longer pollutes the global namespace. All functionality is accessed via
cordova.plugins.locationManager. - Async Pattern: Since version 2, the API is based on Promises rather than callbacks. Methods typically support
.done(),.fail(), and.then(). - Delegate Pattern: To handle asynchronous events (like discovering a beacon or state changes), you must create a
cordova.plugins.locationManager.Delegateinstance and register it usingcordova.plugins.locationManager.setDelegate(delegate). - Data Objects: Use
cordova.plugins.locationManager.BeaconRegionto create Data Transfer Objects (DTOs) representing the beacons you want to monitor or range.