verifyPhoneNumber

AppDelegate.reachfive().verifyPhoneNumber(
    authToken,
    phoneNumber,
    verificationCode
)

Description

Verify the profile’s phone number with the verification code sent by SMS after signup.

  • The profile must have been granted the full_write scope at the last authentication.

Examples

import IdentitySdkCore

let profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

AppDelegate
  .reachfive()
  .verifyPhoneNumber(
      authToken: profileAuthToken,
      phoneNumber: "+33750253354",
      verificationCode: "501028"
  )
  .onSuccess{ _ in
      // Do something
  }
  .onFailure { error in
      // Return a ReachFive error
  }

Parameters

authToken AuthToken

Authorization token of the profile retrieved from login.

idToken string

The ID token JSON Web Token (JWT) that contains the profile’s information.

accessToken string

The authorization credential JSON Web Token (JWT) used to access the ReachFive API.

refreshToken string

The refresh token JSON Web Token (JWT) used to obtain new access tokens once they expire.

tokenType string

The type of token. Always equal to Bearer.

expiresIn number

The lifetime in seconds of the access token.

If expiresIn is less than or equal to 0, the AuthToken is expired.

user OpenIdUser

The user’s information contained in the ID token.

phoneNumber string

The phone number of the profile.

Both the international format and the national conventions of the account’s country are accepted if configured in account settings.

verificationCode string

The verification code sent by email or SMS.

Response

Type: Future<(), ReachFiveError>

If the full_write scope is missing or if the verification code is incorrect, the promise will be rejected and will return a ReachFiveError.

ReachFiveError

Based on the problem, the ReachFiveError will be:

  • RequestError(requestErrors: RequestErrors) if it’s a bad request error.

    error string

    The main error message.

    errorId string

    The identifier of the error.

    errorUserMsg string

    The user-friendly error message.

    This property is translated according to the user’s browser settings. Currently supported languages:
    Currently supported languages
    • de - Deutsch

    • en - English

    • es - Español

    • fr - Français

    • it - Italiano

    • nl - Nederlands

    • ru - Ру́сский (Russian)

    • pt - Portuguese

    errorDescription string

    The technical error message.

    errorDetails FieldError[]

    field string

    The field concerned by the error.

    message string

    The message error returned for the field.

    code string

    The code error returned for the field.

  • AuthFailure(reason: String) if the authentication has failed.

  • AuthCanceled if the authentication was cancelled.

  • TechnicalError(reason: String) if it’s an internal server error.

Feedback