HomeDocs
Skip to main content

dlt.getCountryByIso

Introduction​

Gets the country ID of the phone's SIM card.

Usage Restrictions​

Supported by the base library version 5.0.0 or higher.

Parameters​

Object object

AttributeTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful request.
failfunctionNoCallback function for a failed request.
completefunctionNoCallback function for the end of a request.

object.success Callback Function​

Parameters​

Object res​

AttributeTypeDescription
successstringReturns "true" if successful.
countryCodestringCountry ID of the SIM card.

object.fail Callback Function​

Parameters​

Object res​

AttributeTypeDescription
successstringReturns "false" in case of failed setting.

Sample Code​

// pages/index/index.js
Page({
getCountryByIso() {
dlt.getCountryByIso({
success: (res) => {
console.log('countryCode:', res.countryCode);
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.