Closed chelx closed 3 years ago
My code: ` import SmsListener from 'react-native-android-sms-listener'
SmsListener.addListener( message => { console.log("add:", message) })`
And the result:
LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!000000", "originatingAddress": "123", "timestamp": 1617089036000} LOG add: {"body": "Android is always a sweet treat!111111", "originatingAddress": "123", "timestamp": 1617089045000} LOG add: {"body": "Android is always a sweet treat!111111", "originatingAddress": "123", "timestamp": 1617089045000} LOG add: {"body": "Android is always a sweet treat!111111", "originatingAddress": "123", "timestamp": 1617089045000} LOG add: {"body": "Android is always a sweet treat!111111", "originatingAddress": "123", "timestamp": 1617089045000}
p/s: I run this code on the android emulator
This happen because "addListener" execute every render screen.
My code: ` import SmsListener from 'react-native-android-sms-listener'
SmsListener.addListener( message => { console.log("add:", message) })`
And the result:
p/s: I run this code on the android emulator