Timeout error. Listener never returns event message from sms.
See original GitHub issueEnvironment
- React Native Version: 58.3
- Platform: Android
- Device: Simulator
- OS Version: 9
- react-native-sms-retriever version
- Devtools: Android Studio Version
- Build Tools Version (Android only)
Description
I trigger the _onSmsListenerPressed function with a button. “const registered = await SmsRetriever.startSmsRetriever()” comes back as true. I then send a correctly formatted sms from the Extended Controls panel. After a few minutes I am greeted with "Timeout error."
The sms content never gets returned in the listener.
Solution (Edit)
Just replace com.sms_listener
with your own package name.
The default -alias
for the debug keystore will always be androiddebugkey
keytool -exportcert -alias androiddebugkey -keystore '~\.android\debug.keystore' | xxd -p | tr -d "[:space:]" | echo -n <<<com.sms_listener>>>
cat | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11
If you are using the debug keystore like me, it will ask for a password after you run the above command.
The default password is: android
A string will then be generated, something like this: gaMzAZ+vMRr
Issue Analytics
- State:
- Created 5 years ago
- Comments:32 (3 by maintainers)
Top GitHub Comments
On a Mac I could get this command to work properly:
echo -n "com.yourappname" `keytool -exportcert -keystore ./android/app/debug.keystore -alias androiddebugkey | xxd -p | tr -d "[:space:]"` | sha256sum | xxd -r -p | base64 | cut -c1-11
Now I’ve got hash and it is working. I see my message in my app. I also needed to install coreutils (brew install coreutils) in order to get sha256sum to work
@Technaur @ranjithkumar8352 are you building your apk with the same keys you used to generate the hash? If its debug build and your hash is release apk’s, Android system won’t read the SMS.
Make sure you are building the APK with the same key which is used to generate the hash.