dlt.getLocation
Introduction
The dlt.getLocation
function is used to retrieve the location information of the mobile device.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
success | function | No | Callback function for a successful call. | |
fail | function | No | Callback function for a failed call. | |
complete | function | No | Callback function for the call's completion (executed for both successful and failed calls). |
success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
countryCode | string | The country code. |
latitude | string | The latitude coordinate. |
longitude | string | The longitude coordinate. |
Sample Code
dlt.getLocation({
success(res) {
console.log(res.countryCode);
console.log(res.latitude);
console.log(res.longitude);
},
});