HomeDocs
Skip to main content

dlt.getUniqueId

Introduction

This function is used to obtain a unique identifier for the user, which can be used to identify the user's identity.

Usage Limitations

This function is supported in the basic library version 2.3.0 and later.

Note: The callback of this interface depends on network conditions. It is recommended to add timeout logic to avoid delayed callbacks when there are network fluctuations, which can impact user experience.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful interface call
failfunctionNoCallback function for a failed interface call
completefunctionNoCallback function for the end of an interface call (executed whether the call is successful or failed)

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue - Successful retrieval
uniqueIdstringThe unique identifier

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse - Retrieval failed

Sample Code

// pages/index/index.js
Page({
getUniqueId() {
dlt.getUniqueId({
success:function(res){
console.log("get uniqueId": res.uniqueId)
}
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.