| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The locations sensor provides the best location estimate for the users’ current location, automatically. The location data is provided by Core Location.
iOS 13 or later.
Open Package Manager Windows
Find the package using the manager
Import the package into your target.
Add NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription into Info.plist.
Class to hold the configuration of the sensor.
Contains the locations profiles.
| Field | Type | Description |
|---|---|---|
| latitude | Double | The latitude in degrees. |
| longitude | Double | The longitude in degrees. |
| course | Double | The direction in which the device is traveling, measured in degrees and relative to due north. |
| speed | Double | The instantaneous speed of the device, measured in meters per second. |
| altitude | Double | The altitude, measured in meters. |
| floor | Int | The logical floor of the building in which the user is located. |
| horizontalAccuracy | Double | The radius of uncertainty for the location, measured in meters. |
| verticalAccuracy | Double | The accuracy of the altitude value, measured in meters. |
| deviceId | String | AWARE device UUID |
| label | String | Customizable label. Useful for data calibration or traceability |
| timestamp | Int64 | Unixtime milliseconds since 1970 |
| timezone | Int | Timezone of the device |
| os | String | Operating system of the device (e.g., ios) |
| jsonVersion | Int | JSON schema version |
Contains compass/heading data.
| Field | Type | Description |
|---|---|---|
| magneticHeading | Double | The heading (in degrees) relative to magnetic north. |
| trueHeading | Double | The heading (in degrees) relative to true north. |
| headingAccuracy | Double | The maximum deviation (in degrees) between reported and true heading. |
| x | Double | The geomagnetic data (x-axis) measured in microteslas. |
| y | Double | The geomagnetic data (y-axis) measured in microteslas. |
| z | Double | The geomagnetic data (z-axis) measured in microteslas. |
| deviceId | String | AWARE device UUID |
| label | String | Customizable label. Useful for data calibration or traceability |
| timestamp | Int64 | Unixtime milliseconds since 1970 |
| timezone | Int | Timezone of the device |
| os | String | Operating system of the device (e.g., ios) |
| jsonVersion | Int | JSON schema version |
Contains Core Location lifecycle events, including authorization changes, failures, and pause/resume callbacks.
| Field | Type | Description |
|---|---|---|
| eventType | String | Event type: authorization_changed, failed, paused, or resumed. |
| message | String | Human-readable event detail. |
| errorDomain | String | Error domain for failure events. |
| errorCode | Int | Error code for failure events. |
| authorizationStatus | String | Current Core Location authorization status. |
| accuracyAuthorization | String | Current accuracy authorization on iOS 14 and later. |
| latitude | Double | Last known latitude, if available. |
| longitude | Double | Last known longitude, if available. |
| horizontalAccuracy | Double | Last known horizontal accuracy, if available. |
| deviceId | String | AWARE device UUID |
| label | String | Customizable label. Useful for data calibration or traceability |
| timestamp | Int64 | Unixtime milliseconds since 1970 |
| timezone | Int | Timezone of the device |
| os | String | Operating system of the device (e.g., ios) |
| jsonVersion | Int | JSON schema version |
// To initialize the sensor
let locationSensor = LocationsSensor.init(LocationsSensor.Config().apply { config in
config.sensorObserver = Observer()
config.debug = true
config.dbType = .sqlite
// more configuration...
})
// To start the sensor
locationSensor?.start()
// To stop the sensor
locationSensor?.stop()class Observer:LocationsObserver {
func onLocationChanged(data: LocationsData) {
// your code here
}
}Yuuki Nishiyama (The University of Tokyo), nishiyama@csis.u-tokyo.ac.jp
Copyright (c) 2025 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Back | FazBrowse Home | New Git URL |