api.setAuthenticationPhoneNumber()
Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
Parameters
SetAuthenticationPhoneNumberParams:chevron_leftchevron_right
Parameters
Interface
| Name | Type | Description |
|---|---|---|
phoneNumber | string | The phone number of the user, in international format |
settings | Settings for the authentication of the user's phone number; pass null to use default settings |
Returns
ApiResponse interface:interface ApiResponse {
_: 'setAuthenticationPhoneNumber' | 'error'
airgram: Airgram
request: {
method: 'setAuthenticationPhoneNumber'
params: SetAuthenticationPhoneNumberParams
}
response: |
setState: (nextState: Record<string, unknown>) => void
getState: () => Record<string, unknown>
}