HomeDocs
Skip to main content

dlt.sendToSms

Introduction

Send an SMS (Short Message Service).

Parameters

Object object

PropertyTypeDefaultRequiredDescription
phoneNumberStringYesPhone number
contentStringYesSMS content
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
successstringtrue- Success

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse- Failure

Example Code

// pages/index/index.js
Page({
sendToSms() {
dlt.sendToSms({
phoneNumber: '131000xxxxxxxx',
content: 'hello world',
success: () => {
console.log('success');
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.