HomeDocs
Skip to main content

dlt.getLocation

Introduction

The dlt.getLocation function is used to retrieve the location information of the mobile device.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful call.
failfunctionNoCallback function for a failed call.
completefunctionNoCallback function for the call's completion (executed for both successful and failed calls).

success Callback Function

Parameters

Object res

PropertyTypeDescription
countryCodestringThe country code.
latitudestringThe latitude coordinate.
longitudestringThe longitude coordinate.

Sample Code

dlt.getLocation({
success(res) {
console.log(res.countryCode);
console.log(res.latitude);
console.log(res.longitude);
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.