updatePhoneNumber
AppDelegate.reachfive().updateProfile(authToken, phoneNumber)
Description
Update the profile’s phone number and send a verification code by SMS.
|
Examples
import IdentitySdkCore
let profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login
AppDelegate
.reachfive()
.updatePhoneNumber(
authToken: profileAuthToken,
phoneNumber: "+33792244940"
)
.onSuccess { updatedProfile in
// Get the updated profile
}
.onFailure { error in
// Return a ReachFive error
}
Parameters
Authorization token of the profile retrieved from login.
|
|||||||||||||
The phone number of the profile. The new phone number can be identical to the old one. Both the international format and the national conventions of the account’s country are accepted if configured in account settings. |
Response
Type: Future<Profile, ReachFiveError>
It will return the profile with the updated phone number.
The promise will be rejected and will return a ReachFiveError
if:
-
The parameters are invalid,
-
The
full_write
scope is missing, -
The SMS template is incomplete.
Profile
id |
The ReachFive identifier of the profile. |
||||||||||||||||||||||||
givenName |
The given name of the profile. |
||||||||||||||||||||||||
middleName |
The middle name of the profile. |
||||||||||||||||||||||||
familyName |
The family name of the profile. |
||||||||||||||||||||||||
name |
The full name of the profile. |
||||||||||||||||||||||||
nickname |
The nickname of the profile. |
||||||||||||||||||||||||
birthdate |
The birthdate of the profile, represented as an ISO 8601 |
||||||||||||||||||||||||
profileURL |
The URL of one of the user’s profile page (usually a social provider’s page). |
||||||||||||||||||||||||
picture |
The URL of one of the profile picture. This URL refers to an image file (PNG, JPEG, or GIF image file). |
||||||||||||||||||||||||
externalId |
The external identifier of the profile. |
||||||||||||||||||||||||
authTypes |
The list of the authentication providers used to login by the profile (e.g. facebook, password …). |
||||||||||||||||||||||||
loginSummary |
The login activities history of the profile.
|
||||||||||||||||||||||||
username |
The username of the profile (the login’s name). |
||||||||||||||||||||||||
gender |
The gender of the profile. Allowed values are |
||||||||||||||||||||||||
email |
The primary email address of the profile. |
||||||||||||||||||||||||
emailVerified |
|
||||||||||||||||||||||||
emails |
The e-mail addresses of the profile.
|
||||||||||||||||||||||||
phoneNumber |
The primary 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. |
||||||||||||||||||||||||
phoneNumberVerified |
|
||||||||||||||||||||||||
addresses |
The list of the profile’s postal addresses. To get this attribute, the profile must have been granted the
|
||||||||||||||||||||||||
locale |
The profile’s language code in lowercase and country code in uppercase, separated by a dash (e.g. |
||||||||||||||||||||||||
bio |
The biography of the profile. |
||||||||||||||||||||||||
customFields |
The custom fields of the profile. |
||||||||||||||||||||||||
consents |
The consents granted to the profile. It is a map of string keys with the associated consent object.
|
||||||||||||||||||||||||
createdAt |
The time the profile’s information was created. |
||||||||||||||||||||||||
updatedAt |
The time the profile’s information was last updated. |
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 German -
en
- English -
es
- Español Spanish -
fr
- Français French -
hu
- Magyar Hungarian -
it
- Italiano Italian -
nl
- Nederlands Dutch -
ru
- Ру́сский Russian -
sk
- Slovenský Slovak -
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.