OTPManager
@objc
public class OTPManager : NSObject
A singleton class for performing all the workflows related to OTP code sending and verification.
-
Request the server to send an OTP to the specified user. This API is deprecated.
Declaration
Swift
@available(*, deprecated, message: "Use requestOTP(recipient:recipientType:purpose:completion:﹚ instead") @objc public static func requestOTP(recipient: String, recipientType: IdType, purpose: OTPPurpose, isFutureUpdate: Bool = false, completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
recipientThe address the OTP should be sent to. Typically the user’s email address or mobile phone number.
recipientTypeRecipient’s Id type.
purposehe purpose of the OTP. See
OTPPurposefor options.isFutureUpdateThis parameter is unused and will be ignored.
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Request the server to send an OTP to the specified user. This api supports sending OTP for signup / onboarding purposes.
Declaration
Swift
@objc public static func requestOTP(recipient: String, recipientType: IdType, purpose: OTPPurpose, completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
recipientThe address the OTP should be sent to. Typically the user’s email address or mobile phone number.
recipientTypeRecipient’s Id type.
purposehe purpose of the OTP. See
OTPPurposefor options.completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Request the server to send an OTP to the specified user. This API is deprecated & does not support sending OTP for signup / onboarding purposes.
Declaration
Swift
@available(*, deprecated, message: "Use requestOTP(recipient:recipientType:purpose:completion:﹚ instead") @objc public static func requestOTP(recipient: String, purpose: OTPPurpose, completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
recipientThe address the OTP should be sent to. Typically the user’s email address or mobile phone number.
purposeThe purpose of the OTP. See
OTPPurposefor options.completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Verify an OTP code sent to user with the server.
Declaration
Swift
@available(*, deprecated, message: "Use verifyOTP(code:purpose:session:recipient:recipientType:completion:﹚ instead") @objc public static func verifyOTP(code: String, purpose: OTPPurpose, session: String = "", completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
codeThe one time password code sent to the user.
purposeThe purpose of the OTP. See
OTPPurposefor options.sessionThe session ID for the OTP.
completionBlock that will be called once verification is completed. The block will provide an OTPSession object for purposes like
.forgotPasswordto be used with subsequent calls of setting a new password. The block will also provide an error object if verification fails. -
Verify an OTP code sent to user with the server. This API is deprecated.
Declaration
Swift
@available(*, deprecated, message: "Use verifyOTP(code:purpose:session:recipient:recipientType:completion:﹚ instead") @objc public static func verifyOTP(code: String, purpose: OTPPurpose, session: String = "", recipient: String, recipientType: IdType, isFutureUpdate: Bool = false, completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
codeThe one time password code sent to the user.
purposeThe purpose of the OTP. See
OTPPurposefor options.sessionThe session ID for the OTP.
recipientThe destination for OTP e.g email address, mobile number, vin.
recipientTypeThe type of value used in recipient parameter. Refer to
IdType.isFutureUpdateThis parameter is unused and will be ignored.
completionBlock that will be called once verification is completed. The block will provide an OTPSession object for purposes like
.forgotPasswordto be used with subsequent calls of setting a new password. The block will also provide an error object if verification fails. -
Verify an OTP code sent to user with the server.
Declaration
Swift
@objc public static func verifyOTP(code: String, purpose: OTPPurpose, session: String = "", recipient: String, recipientType: IdType, completion: @escaping (OTPSession?, NSError?) -> Void)Parameters
codeThe one time password code sent to the user.
purposeThe purpose of the OTP. See
OTPPurposefor options.sessionThe session ID for the OTP.
recipientThe destination for OTP e.g email address, mobile number, vin.
recipientTypeThe type of value used in recipient parameter. Refer to
IdType.completionBlock that will be called once verification is completed. The block will provide an OTPSession object for purposes like
.forgotPasswordto be used with subsequent calls of setting a new password. The block will also provide an error object if verification fails.
OTPManager Class Reference