LCSMSClient
public class LCSMSClient
Short Message Service (SMS) Client, you can use it to send short message to mobile phone.
-
requestShortMessage(application:
mobilePhoneNumber: templateName: signatureName: captchaVerificationToken: variables: ) Request a short message synchronously.
Declaration
Swift
public static func requestShortMessage( application: LCApplication = .default, mobilePhoneNumber: String, templateName: String? = nil, signatureName: String? = nil, captchaVerificationToken: String? = nil, variables: LCDictionaryConvertible? = nil) -> LCBooleanResult
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number where short message will be sent to.
templateName
The template name.
signatureName
The signature name.
captchaVerificationToken
The token return by captcha verification for requesting sms.
variables
The custom variables.
-
requestShortMessage(application:
mobilePhoneNumber: templateName: signatureName: captchaVerificationToken: variables: completionQueue: completion: ) Request a short message asynchronously.
Declaration
Swift
@discardableResult public static func requestShortMessage( application: LCApplication = .default, mobilePhoneNumber: String, templateName: String? = nil, signatureName: String? = nil, captchaVerificationToken: String? = nil, variables: LCDictionaryConvertible? = nil, completionQueue: DispatchQueue = .main, completion: @escaping (LCBooleanResult) -> Void) -> LCRequest
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number where short message will be sent to.
templateName
The template name.
signatureName
The signature name.
captchaVerificationToken
The token return by captcha verification for requesting sms.
variables
The custom variables.
completionQueue
The queue where
completion
be executed, default is main.completion
Result callback.
-
Request a verification code synchronously.
Declaration
Swift
public static func requestVerificationCode( application: LCApplication = .default, mobilePhoneNumber: String, applicationName: String? = nil, operation: String? = nil, timeToLive: UInt? = nil) -> LCBooleanResult
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number where verification code will be sent to.
applicationName
The name of application in the short message, default is the name of application in console.
operation
The name of operation in the short message, default is “短信验证”.
timeToLive
The time to live(unit is minute) of the verification code, default is 10 minutes.
-
requestVerificationCode(application:
mobilePhoneNumber: applicationName: operation: timeToLive: completionQueue: completion: ) Request a verification code asynchronously.
Declaration
Swift
@discardableResult public static func requestVerificationCode( application: LCApplication = .default, mobilePhoneNumber: String, applicationName: String? = nil, operation: String? = nil, timeToLive: UInt? = nil, completionQueue: DispatchQueue = .main, completion: @escaping (LCBooleanResult) -> Void) -> LCRequest
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number where verification code will be sent to.
applicationName
The name of application in the short message, default is the name of application in console.
operation
The name of operation in the short message, default is “短信验证”.
timeToLive
The time to live(unit is minute) of the verification code, default is 10 minutes.
completionQueue
The queue where
completion
be executed, default is main.completion
Result callback.
-
Request a voice verification code synchronously.
Declaration
Swift
public static func requestVoiceVerificationCode( application: LCApplication = .default, mobilePhoneNumber: String) -> LCBooleanResult
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number be called.
-
Request a voice verification code asynchronously.
Declaration
Swift
@discardableResult public static func requestVoiceVerificationCode( application: LCApplication = .default, mobilePhoneNumber: String, completionQueue: DispatchQueue = .main, completion: @escaping (LCBooleanResult) -> Void) -> LCRequest
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number be called.
completionQueue
The queue where
completion
be executed, default is main.completion
Result callback.
-
Verify a verification code synchronously.
Declaration
Swift
public static func verifyMobilePhoneNumber( application: LCApplication = .default, _ mobilePhoneNumber: String, verificationCode: String) -> LCBooleanResult
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number which you want to verify.
verificationCode
The verification code which sent to the mobile phone number.
-
Verify a verification code asynchronously.
Declaration
Swift
@discardableResult public static func verifyMobilePhoneNumber( application: LCApplication = .default, _ mobilePhoneNumber: String, verificationCode: String, completionQueue: DispatchQueue = .main, completion: @escaping (LCBooleanResult) -> Void) -> LCRequest
Parameters
application
The application, default is
LCApplication.default
.mobilePhoneNumber
The mobile phone number which you want to verify.
verificationCode
The verification code which sent to the mobile phone number.
completionQueue
The queue where
completion
be executed, default is main.completion
Result callback.