opentrace-community / opentrace-android

OpenTrace Android app. Reference implementation of the BlueTrace protocol.
https://bluetrace.io
GNU General Public License v3.0
577 stars 223 forks source link

Verification failed: Failed to retrieve HandShakePin NOT_FOUND #9

Closed valduze closed 4 years ago

valduze commented 4 years ago

Hi Guys, This application fail to verify and below is my debug long:

2020-04-12 15:18:53.215 16812-16812/net.za.jongi.masiphandisane D/OnboardingActivity:  NOT-IDLE Retrieved Temporary ID successfully
2020-04-12 15:18:53.611 16812-16812/net.za.jongi.masiphandisane W/Utils:  NOT-IDLE get handshake pin (failure): NOT_FOUND
2020-04-12 15:18:53.620 16812-16812/net.za.jongi.masiphandisane E/OnboardingActivity:  NOT-IDLE Failed to retrieve HandShakePin NOT_FOUND

Please let me know what I am missing. Thanks, Jongi

rinekri commented 4 years ago

@valduze I had the same problem now, but I fixed it. You should set FIREBASE_REGION const in gradle.properties according to cloud function region, not FB console. For example, if you set regions: ["europe-west1"] in config.ts, then FIREBASE_REGION should be the same.

valduze commented 4 years ago

Hi @rinekri I have checked that, I have same FIREBASE_REGION i.e us-east1

grep us-east1 gradle.properties
FIREBASE_REGION = "us-east1"

and

grep us-east1 functions/src/config.ts
  regions: ["us-east1"],

I still get the same error:

2020-04-13 00:57:29.639 9009-9009/net.za.jongi.masiphandisane D/OnboardingActivity:  NOT-IDLE Retrieved Temporary ID successfully
2020-04-13 00:57:30.044 9009-9009/net.za.jongi.masiphandisane W/Utils:  NOT-IDLE get handshake pin (failure): NOT_FOUND
2020-04-13 00:57:30.052 9009-9009/net.za.jongi.masiphandisane E/OnboardingActivity:  NOT-IDLE Failed to retrieve HandShakePin NOT_FOUND

I also double checked if my Kotlin function was calling it correctly and it does on: OnboardingActivity class line 61:

private val functions = FirebaseFunctions.getInstance(BuildConfig.FIREBASE_REGION)

That is where it's defined and it's pointing to an autogenerated BuildConfig.java which is on line 22 :

public static final String FIREBASE_REGION = "us-east1";

So I am 100% sure, I am pointing it to the correct FIREBASE_REGION . I cleaned and rebuild the Android app, I am going to try to clean and rebuild the cloud-functions as well and see if it doesn't go away.

Thanks for your help. Regards, Jongi

rinekri commented 4 years ago

@valduze it's super strange. Open firebase console and check a functions list and its addresses. Maybe you didn't upload them correctly? Because

HandShakePin NOT_FOUND

appears when sample application can't reach specified function.

SHA1 should be added too, as mentioned someone here, but it will be useful on next step if you get HandShakePin correctly

valduze commented 4 years ago

Thank you so much @rinekri Now my app authenticate and verify correctly. I re-deployed the function, I think I could have missed something. Now all good.

Thank you for your help, this ticket can now be closed. Thanks, Jongi

rinekri commented 4 years ago

@valduze cool! I'm happy that it was useful :)

hacker-0123 commented 4 years ago

I Have same problem.

D/OnboardingActivity: NOT-IDLE Retrieved Temporary ID successfully I/OpenGLRenderer: prepareTree mLayerUpdateQueue is not empty, size = 1 I/OpenGLRenderer: name = FrameLayout, size (1080, 1920) W/Utils: NOT-IDLE get handshake pin (failure): NOT_FOUND E/OnboardingActivity: NOT-IDLE Failed to retrieve HandShakePin NOT_FOUND

could not able to resolve this issue.

rinekri commented 4 years ago

@hacker-0123 did you try what I described here?

hacker-0123 commented 4 years ago

Yeah, I have tried all. Do i have to do Remote config additional work for this to work as mentioned in their doc.

Interesting thing is When I give different number it is working.

rinekri commented 4 years ago

@hacker-0123 hm it's difficult to say what is wrong in your specific case without seeing source code. If you will share me repositories and fb console, maybe I will help you more efficiently. You can contact me by email address in my profile

hacker-0123 commented 4 years ago

@rinekri that earlier is resolved, it was my phone problem. I had to restart phone however i am facing new problem. When even the OTP is correct and the time is not expired. It still shows the code has expired.

Error Message I get. The sms code has expired. Please re-send the verification code to try again.-ERROR_SESSION_EXPIRED