With this module you can check the device location settings, get the last known location information once or continuously, set mock location and others
HMSActivityIdentification
If your app needs to obtain the activity status of the user's device (for example, walking, running, or bicycling) or your app needs to detect activity status change of a user, you can use this module.
HMSGeofence
If you are interested in a place, you can create a geofence based on the place. When the device enters the geofence or stays for a duration of time, a notification can be sent to your app.
Common Functions
Return Type
Function
void
registerHMSEvent(eventName, handler)
void
unregisterHMSEvent(eventName, handler)
HMSLocationKit
Return Type
Function
Promise<>
init()
HMSFusedLocation
Data Types
LocationData
Field
Type
latitude
Float
Latitude of a location. If no latitude is available, 0.0 is returned.
longitude
Float
Longitude of a location. If no longitude is available, 0.0 is returned.
speed
Float
Speed of a device at the current location, in meters per second. If no speed is available, 0.0 is returned.
bearing
Float
Bearing of a device at the current location, in degrees. If no bearing is available, 0.0 is returned.
accuracy
Float
Horizontal error of a location, in meters. If no horizontal error is available, 0.0 is returned.
verticalAccuracyMeters
Float
Vertical error of a location, in meters. If no vertical error is available, 0.0 is returned.
bearingAccuracyDegrees
Float
Bearing error of the current location, in degrees. If no bearing error is available, 0.0 is returned.
speedAccuracyMetersPerSecond
Float
Speed error of a device at the current location, in meters per second. If no speed error is available, 0.0 is returned.
time
Float
Current timestamp, in milliseconds.
fromMockProvider
Boolean
Indicates whether location coming from mock provider.
LocationRequest
Field
Type
Description
priority
Number
Request priority. The default value is 100.
interval
Float
Request interval, in milliseconds. The default value is 3600000.
numUpdates
Number
Number of requested location updates.
fastestInterval
Float
Shortest request interval, in milliseconds. The default value is 600000. If another app initiates a location request, the location is also reported to the app at the interval specified in fastestInterval.
expirationTime
Float
Request expiration time, in milliseconds.
expirationTimeDuration
Float
Request expiration duration, in milliseconds.
smallestDisplacement
Float
Minimum displacement between location updates, in meters.
maxWaitTime
Float
Maximum waiting timeIndicates whether to return the address information. The default value is false.
needAddress
Boolean
Indicates whether to return the address information. The default value is false.
language
String
Language. The value consists of two letters and complies with the ISO 639-1 international standard. By default, the value is empty.
countryCode
String
Country code. The value consists of two letters and complies with the ISO 3166-1 international standard. By default, the value is empty.
Unique ID. If the unique ID already exists, the new geofence will overwrite the old one.
conversions
Number
Geofence conversions. The bitwise-OR operation is supported.
validContinueTime
Float
Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time.
dwellDelayTime
Number
Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time.
notificationInterval
Number
Notification response capability. The default value is 0. Setting it to a larger value can reduce power consumption accordingly. However, reporting of geofence events may be delayed.
GeofenceResponse
Fields
Type
Description
uniqueId
String
Unique id
GeofenceData
Fields
Type
convertingGeofenceList
Array
Information about converted geofences.
conversion
Number
Geofence convert type.
convertingLocation
Array
The location when a geofence is converted.
errorCode
Number
Error code. For details, please refer to Cordova Result Codes.