为什么我在打电话时收到电话号码“未占用”错误授权签名在电报里?

2024-09-29 01:28:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经到了发送auth.sendCode方法的地步,并给出了以下响应:

('sentCode: ', {u'req_msg_id': 6324698204597889024L, u'result': {u'type': {u'len
gth': 5}, u'phone_registered': False, u'flags': 6, u'timeout': 120, u'next_type'
: {}, u'phone_code_hash': '52eb4ab096ea211b52'}})

这是使用电报测试服务器。我已经成功地在telegram iPhone应用程序和桌面应用程序中使用了相同的电话号码,因此我知道该电话号码在生产中是有效的。(它在测试服务器上是否也有效?)在

当我跟随auth.sendCode和{}时,我收到以下错误响应:

^{pr2}$

这两种注册电话号码的方法之间有步骤吗?在


Tags: 方法服务器authid应用程序lentypephone
3条回答

看看this page。因此,生产电话注册不适用于test\U dc。在

根据该页的说明:

use "auth.signUp" instead "auth.signIn"

如果您确定您的手机已注册,则此错误的原因也可能是TdLibParameters错误/不完整。我的android项目就是这样。最后,我得出了以下清单:

    parameters.useTestDc = false
    parameters.databaseDirectory = appFolder
    parameters.filesDirectory = appFolder
    parameters.useFileDatabase = false
    parameters.useChatInfoDatabase = false
    parameters.useMessageDatabase = false
    parameters.useSecretChats = false
    parameters.apiId = 1111
    parameters.apiHash = "1111"
    parameters.systemLanguageCode = Locale.getDefault().isO3Language
    parameters.deviceModel = Build.MODEL
    parameters.systemVersion = Build.VERSION.RELEASE.toString()
    parameters.applicationVersion = "0.1"
    parameters.enableStorageOptimizer = true
    parameters.ignoreFileNames = true

来自https://core.telegram.org/api/auth

The auth.sendCode method will also return the phone_registered field, which indicates whether or not the user with this phone number is registered in the system. If phone_registered == boolTrue, authorization requires that auth.signIn be invoked. Otherwise, basic information must be requested from the user and the new user registration method (auth.signUp) must be invoked.

When phone_registered === boolFalse, the auth.signIn method can be used to pre-validate the code entered from the text message. The code was entered correctly if the method returns Error 400 PHONE_NUMBER_UNOCCUPIED.

相关问题 更多 >