Functions

The following functions are available globally.

  • Create a new SMS verification.

    Declaration

    Swift

    public func SMSVerification(_ applicationKey: String, phoneNumber: String, languages: [String]) -> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    languages

    The preferred content language for SMS verification. It is specified via a list of IETF language tags in order of priority. If the first language is not available, the next one will be selected and so forth. The default is ‘en-US’.

    Return Value

    A new SMS Verification object.

  • Create a new SMS verification.

    Declaration

    Swift

    public func SMSVerification(_ applicationKey: String, phoneNumber: String) -> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    Return Value

    A new SMS Verification object.

  • Create a new SMS verification.

    Declaration

    Swift

    public func SMSVerification(_ applicationKey: String, phoneNumber: String, custom: String) -> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    custom

    Application-specific custom data that will be passed to REST API callbacks made to the application’s backend. This custom data will also be written to CDRs (Call Detail Records). (If complex data is to be passed along, it must first be encoded as a NSString*, e.g. encoded as JSON or Base64.)

    Return Value

    A new SMS Verification object.

  • Create a new SMS verification.

    Declaration

    Swift

    public func SMSVerification(_ applicationKey: String, phoneNumber: String, custom: String, languages: [String])-> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    custom

    Application-specific custom data that will be passed to REST API callbacks made to the application’s backend. This custom data will also be written to CDRs (Call Detail Records). (If complex data is to be passed along, it must first be encoded as a NSString*, e.g. encoded as JSON or Base64.)

    languages

    The preferred content language for SMS verification. It is specified via a list of IETF language tags in order of priority. If the first language is not available, the next one will be selected and so forth. The default is ‘en-US’.

    Return Value

    A new SMS Verification object.

  • Create a new Callout verification.

    Declaration

    Swift

    public func CalloutVerification(_ applicationKey: String, phoneNumber: String) -> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    Return Value

    A new Callout Verification object.

  • Create a new Callout verification.

    Declaration

    Swift

    public func CalloutVerification(_ applicationKey: String, phoneNumber: String, custom:String) -> Verification

    Parameters

    applicationKey

    Application key identifying the application.

    phoneNumber

    The phone number to verify. The phone number should be given according to E.164 number formatting (http://en.wikipedia.org/wiki/E.164) and should be prefixed with a ‘+’. E.g. to call the US phone number 415 555 0101, it should be specified as “+14155550101”, where the ‘+’ is the required prefix and the US country code ‘1’ added before the local subscriber number.

    custom

    Application-specific custom data that will be passed to REST API callbacks made to the application’s backend. This custom data will also be written to CDRs (Call Detail Records). (If complex data is to be passed along, it must first be encoded as a NSString*, e.g. encoded as JSON or Base64.)

    Return Value

    A new Callout Verification object.

  • Get a shared instance of PhoneNumberUtil.

    Declaration

    Swift

    public func SharedPhoneNumberUtil() -> PhoneNumberUtil

    Return Value

    shared PhoneNumberUtil