Td: How to set AuthenticationCodeType to AuthenticationCodeTypeSms ?

Created on 25 Aug 2019  路  6Comments  路  Source: tdlib/td

How to set AuthenticationCodeType to AuthenticationCodeTypeSms ?

Most helpful comment

@huang-ju When you receive an authorizationStateWaitCode response it will contain a code_info_ property which tells you how the authorization code was sent, i.e. via Telegram message or SMS, the code will usually be sent through via Telegram message first, in order to send it via SMS you would have to call the resendAuthenticationCode but this will only work if current authorization state is authorizationStateWaitCode and the next_type_ property of authorizationStateWaitCode class is authenticationCodeTypeSms.

Hope that helps

EDIT: I don't think there is a way to make TDLib send authentication code via SMS without first sending it as a Telegram message.

All 6 comments

I want code to be sent via SMS

@huang-ju When you receive an authorizationStateWaitCode response it will contain a code_info_ property which tells you how the authorization code was sent, i.e. via Telegram message or SMS, the code will usually be sent through via Telegram message first, in order to send it via SMS you would have to call the resendAuthenticationCode but this will only work if current authorization state is authorizationStateWaitCode and the next_type_ property of authorizationStateWaitCode class is authenticationCodeTypeSms.

Hope that helps

EDIT: I don't think there is a way to make TDLib send authentication code via SMS without first sending it as a Telegram message.

@chairus How do I set the nextType to AuthenticationCodeTypeSms ?

@huang-ju There is no way to do that.

image

@levlam Why can clients send SMS?

@huang-ju See absolutely correct answer of @chairus again. That's all that clients can do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omkarnathsingh picture omkarnathsingh  路  4Comments

devxpy picture devxpy  路  5Comments

RadRussianRus picture RadRussianRus  路  3Comments

isopen picture isopen  路  5Comments

Invision70 picture Invision70  路  3Comments