Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Java example auth without phone number #3467

@tashoyan

Description

@tashoyan

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 = <...>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions