td icon indicating copy to clipboard operation
td copied to clipboard

How to use the test server

Open gohj99 opened this issue 6 months ago • 12 comments

How to use the test server

I saw the test server at https://my.telegram.org/ and would like to ask how to use it in td, thanks

gohj99 avatar Jun 21 '25 16:06 gohj99

See https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_tdlib_parameters.html.

levlam avatar Jun 21 '25 21:06 levlam

When using test dc, do I need to pass the IP address of the test dc? (Such "149.154.167.40:443")

gohj99 avatar Jun 22 '25 09:06 gohj99

Where do you want to pass the IP address in setTdlibParameters request?

levlam avatar Jun 22 '25 18:06 levlam

Sorry, I know setTdlibParameters can't pass the IP address

I see this doc "https://core.telegram.org/api/auth#test-accounts" But when I try to use the test-accounts through is "PHONE_CODE_INVALID" (I used TestDc)

Image Image

gohj99 avatar Jun 23 '25 05:06 gohj99

Test accounts are disabled currently. You need to register an account using a real phone number, which should be possible to do from the official iOS app in the following way: tap 10 times on the Settings icon > Accounts > Login to another account > Test. The official Android app from Play store doesn't provide the ability to log in to test DC and other apps can't be used to register a new account.

levlam avatar Jun 23 '25 06:06 levlam

So now can I set a phone code to login in after I register a account?

gohj99 avatar Jun 23 '25 07:06 gohj99

If you have already registered an account in Test DC, then you can log in in the account using TDLib and the code sent to another logged in device.

levlam avatar Jun 23 '25 10:06 levlam

Thank, I know your mean But sorry, I will push the app to review, it must need a account and password, if so review will be unable.

gohj99 avatar Jun 23 '25 15:06 gohj99

App Store reviewers can use the test accounts. Google Play reviewers need some other way to log in into an account.

levlam avatar Jun 23 '25 19:06 levlam

Is there a way to specify a phone code?

If not, I only way is ues bot token to login in, but bot account will miss many features

gohj99 avatar Jun 24 '25 04:06 gohj99

Is there a way to specify a phone code?

No. The only way is to automate code retrieving and provide the way to get it for reviewers.

levlam avatar Jun 24 '25 08:06 levlam

OK, I have prepared the method for using the automatic test. If anyone needs it, you can refer to it.

https://github.com/TGwear/TGwear/blob/develop/app/src/main/java/com/gohj99/tgwear/LoginActivity.kt#L226 https://github.com/TGwear/TGwear_test_auto_receive_code

gohj99 avatar Jun 28 '25 13:06 gohj99