question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timeout error. Listener never returns event message from sms.

See original GitHub issue

Environment

  • 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:closed
  • Created 5 years ago
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
stepdicommented, Nov 1, 2020

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

5reactions
mprakicommented, Mar 5, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google SMS Retriever API not retreiving SMS messages
This only triggers when a TIMEOUT event is sent 5 minutes after the SMS retriever client starts. It never triggers for SMS messages....
Read more >
Amazon SQS visibility timeout - Amazon Simple Queue Service
If you use long polling, Amazon SQS returns no error messages. To avoid reaching the quota, you should delete messages from the queue...
Read more >
SmsManager - Android Developers
Manages SMS operations such as sending data, text, and pdu SMS messages. ... Callback and listener events are dispatched through this Executor ,...
Read more >
Twilio Function Execution
Learn the process of how your Twilio Function code is executed, details about the parameters it receives, and how to construct a response....
Read more >
Messenger: Sync & Queued Message Handling (Symfony Docs)
Timeout before retrying a message that's in the queue but in the "handling" state (if a worker stopped for some reason, this will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found