HomeDocs
Skip to main content

dlt.getNetworkType

Introduction​

The dlt.getNetworkType function is used to get the current network environment.

Parameters​

Object object​

PropertyTypeDefault ValueRequiredDescription
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function that is called when the API call is complete (whether successful or not).

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
networkTypestringThe current network environment.

Possible Values for networkType​

ValueDescription
wifiWi-Fi network
2g2G network
3g3G network
4g4G network
5g5G network
unknownUncommon network types on Android
noneNo network

Example Code​

dlt.getNetworkType({
success(res) {
console.log(res.networkType);
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.