SMS retriever api wont read OTP from SMS automatic

2019-08-17 14:41发布

I generated Hash from AppSignatureHelper class which works for debug build, same didn't work for release build, so I generated a hash using keystore and alias using command https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string and updated to SMS text, this too didn't work.

2条回答
劫难
2楼-- · 2019-08-17 15:11

First publish app on play store then do these steps :

  1. Go to Release management in developer console.
  2. Click on App signing.

I have added an example you can check in below SS.

enter image description here

EDIT 1:-

Steps for Release Hashkey:

  • Download Openssl (Download from here), I have downloaded for 64 bit OS, you can find more here
  • Extract downloaded zip file to C:\ drive only
  • Open command prompt
  • keytool -exportcert -alias **myaliasname** -keystore **"C:\Users\hiren.patel\Desktop\mykeystore.jks"** | "C:\openssl-0.9.8e_X64\bin\openssl.exe" sha1 -binary | "C:\openssl-0.9.8e_X64\bin\openssl.exe" base64

Kindly change Alias Name and Keystore with it's path as your requirement.

Note:

Please put your details where I have marked between ** **.

Terminal would ask for Password of Keystore. You have to provide password for the same Keystore.

So finally you would get the Release Hashkey.

Done

EDIT 2:

Use this command in linux :

echo 33:4E:48:84:19:50:3A:1F:63:A6:0F:F6:A1:C2:31:E5:01:38:55:2E | xxd -r -p | openssl base64 

if you don't have linux OS then you can do this online : using this link :

https://rextester.com/l/bash_online_compiler

Note : USE API SIGNING KEY FROM DEVELOPER CONSOLE. enter image description here

Edit 3:

Try generating hash without alias for Google APK Sign Enabled

i.e

keytool -exportcert -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11

NOTE : SHA-256 certificate fingerprint, take this from developer console

查看更多
爷的心禁止访问
3楼-- · 2019-08-17 15:14

Finally this solved my problem How to generate 11 char hash key for Sms Retriever with Google App signing

The solution mentioned by @farhan in his question helped

查看更多
登录 后发表回答