big20scoops / Telegram-React-Native-Starter

This repository contains an example of integration Telegram with React-Native from authentication to show contacts list.
2 stars 0 forks source link

Cannot receive code when downloading and running #1

Open Don-oneself opened 3 years ago

Don-oneself commented 3 years ago

Run the code after downloading, and there is no response after entering the phone number, and Xcode prompts an error after clicking twice.

Environment: XCode

XCode Return example

[ 3][t 8][1637333128.381702899][Td.cpp:3370][#2][!Td][&td_requests] Receive request 4: setAuthenticationPhoneNumber { phone_number = "+85268542***" settings = null } [ 3][t 8][1637333128.381740093][NetQueryCreator.cpp:28][#2][!AuthManager] Create query auth_sendCode { phone_number = "+85268542***" api_id = 9473*** api_hash = "0771ea908bd98e7eebb40ee4fa14****" settings = codeSettings { flags = 0 } } [ 3][t 8][1637333128.381757974][NetQuery.h:360][#2][!AuthManager] [Query:[id:196608][tl:0xa677244f][state:Query]] [ 3][t 8][1637333128.381774187][NetQuery.h:244][#2][!AuthManager][&net_query] [Query:[id:196608][tl:0xa677244f][state:Query]] [state:sent to main session multi proxy DcId{1}] [ 3][t 8][1637333128.381787061][NetQuery.h:244][#2][!SessionProxy:1:main][&net_query] [Query:[id:196608][tl:0xa677244f][state:Query]] [state:SessionProxy:1:main: sent to session] [ 3][t 8][1637333128.381794214][Session.cpp:260][#2][!Session:1:main][&net_query] Got query [Query:[id:196608][tl:0xa677244f][state:Query]] [ 3][t 8][1637333128.381798982][NetQuery.h:244][#2][!Session:1:main][&net_query] [Query:[id:196608][tl:0xa677244f][state:Query]] [state:Session: pending] [ 3][t 0][1637333130.703763008][Client.cpp:283][&td_requests] End to wait for updates, returning object 0 0x0 tdlibs: running [ 3][t 0][1637333130.703800201][Client.cpp:275][&td_requests] Begin to wait for updates with timeout 10.000000 [ 3][t 8][1637333133.333635091][Td.cpp:3370][#2][!Td][&td_requests] Receive request 5: setAuthenticationPhoneNumber { phone_number = "+85268542***" settings = null } [ 3][t 8][1637333133.333665132][NetQueryCreator.cpp:28][#2][!AuthManager] Create query auth_sendCode { phone_number = "+85268542***" api_id = 9473*** api_hash = "0771ea908bd98e7eebb40ee4fa145***" settings = codeSettings { flags = 0 } } [ 3][t 8][1637333133.333676099][NetQuery.h:360][#2][!AuthManager] [Query:[id:262144][tl:0xa677244f][state:Query]] [ 3][t 8][1637333133.333685159][NetQuery.h:244][#2][!AuthManager][&net_query] [Query:[id:262144][tl:0xa677244f][state:Query]] [state:sent to main session multi proxy DcId{1}] [ 3][t 8][1637333133.333693027][NetQuery.h:244][#2][!SessionProxy:1:main][&net_query] [Query:[id:262144][tl:0xa677244f][state:Query]] [state:SessionProxy:1:main: sent to session] [ 3][t 8][1637333133.333703041][Session.cpp:260][#2][!Session:1:main][&net_query] Got query [Query:[id:262144][tl:0xa677244f][state:Query]] [ 3][t 8][1637333133.333709239][NetQuery.h:244][#2][!Session:1:main][&net_query] [Query:[id:262144][tl:0xa677244f][state:Query]] [state:Session: pending] [ 3][t 8][1637333133.333955287][Td.cpp:4543][#2][!Td][&td_requests] Sending error for request 4: error { code = 9 message = "Another authorization query has started" }

Because I don’t know how to write code for android and ios, how can I return errors thrown in ios and Android to react-native

big20scoops commented 3 years ago

@Don-oneself Sorry for the late response since I think no one would be interested in this.

You can filter tdlibs: in Xcode->Debug Area to see logs about Telegram.

And if you still don't know, feel free to ask me.

Don-oneself commented 3 years ago

When I filter tdlibs: in Xcode->Debug Area to see logs The first time click send, it just prints tdlibs: running Send for the second time, print tdlibs:{"@type":"error","code":9,"message":"Another authorization query has started","@extra":1} Sorry, I don’t understand the native code very well, and I need to trouble you.

big20scoops commented 3 years ago

@Don-oneself I have never faced this issue, I will look into it. but please check the following:

1.) Should enter the phone number in international format => +000000000. 2.) Phone number must be registered to Telegram => In this example, I don't implement register flow yet.

But I tried to enter the phone number randomly. Also, tried using your phone still works fine for me. Maybe wait a little bit. Keep in mind that Telegram is Fully-asynchronous, so it is not blocking UI. https://core.telegram.org/tdlib

🙏Sorry for not asking for permission to use your phone number.🙏

I tested on Simulator iPhone 8 (13.7),Xcode 13.1

Can you provide me with more about your development environment?

Don-oneself commented 3 years ago

I did receive the verification code just now I also tested on Simulator iPhone 8, Xcode 13.1,But I still can’t receive the verification code, and I haven’t received it after a long time.

download this library npm i npx pod-install download libtdjson.dylib && copy into ios > td > lib > libtdjson.dylib

Do you need to perform other operations?

big20scoops commented 3 years ago

@Don-oneself That all you need to do. 1.) npm install 2.) arch -x86_64 pod install since I used M1. 3.) download and paste libtdjson.dylib

I never used pod-install, so maybe there is something different.

Or maybe you can try to create your own telegram app here: https://my.telegram.org/auth

Or find the answer in the official repository here: https://github.com/tdlib/td/issues

Don-oneself commented 3 years ago

Thank you very much, and sorry to bother you for so long. I will continue to research, thanks again.