Using the Headless SDK, requests can be easily customized to set a specific expiry, adjust the OTP length, and select a preferred delivery channel such as WhatsApp, SMS, or Viber for phone number authentication.
Headless request can be customized with custom expiry.
let headlessRequest =HeadlessRequest()headlessRequest.setPhoneNumber(number:"PHONE_NUMBER", withCountryCode:"COUNTRY_CODE")// in secondsheadlessRequest.setExpiry(expiry:"60")Otpless.sharedInstance.startHeadless(headlessRequest: headlessRequest)
Headless request can be customized with custom OTP length 4 or 6.
let headlessRequest =HeadlessRequest()headlessRequest.setPhoneNumber(number:"PHONE_NUMBER", withCountryCode:"COUNTRY_CODE")// only 4 or 6 headlessRequest.setOtpLength(otpLength:"6")Otpless.sharedInstance.startHeadless(headlessRequest: headlessRequest)
Headless request can be customized with custom Delivery Channel like WHATSAPP, SMS and VIBER.
let headlessRequest =HeadlessRequest()headlessRequest.setPhoneNumber(number:"PHONE_NUMBER", withCountryCode:"COUNTRY_CODE")// WHATSAPP,SMS and VIBERheadlessRequest.setDeliveryChannel("WHATSAPP")Otpless.sharedInstance.startHeadless(headlessRequest: headlessRequest)