td
td copied to clipboard
Java example auth without phone number
When I run the Java example, it asks for phone number. Then I have to login to my Telegram account using a passcode.
Is it possible to authenticate with app_id and app_hash, without specifying the phone number?
There is a piece of code specifying app_id and app_hash, but it seems unused. The example application always asks for phone number, no matter which app_id and app_hash values I specify.
switch (Example.authorizationState.getConstructor()) {
case TdApi.AuthorizationStateWaitTdlibParameters.CONSTRUCTOR:
TdApi.SetTdlibParameters request = new TdApi.SetTdlibParameters();
request.databaseDirectory = "tdlib";
request.useMessageDatabase = true;
request.useSecretChats = true;
request.apiId = <...>;
request.apiHash = <...>;
No, it is not possible to log in to a Telegram account without a phone number.
Then what's the use of app_id and app_hash?
They are used to identify the application.