andreyvital / react-native-android-sms-listener

Allows you to listen for incoming SMS messages using React Native
MIT License
358 stars 99 forks source link

(1) Multiple registrations of Receiver (2) doesn't work when app is closed #20

Closed y2k-shubham closed 6 years ago

y2k-shubham commented 7 years ago

(1) If the app is closed (doesn't matter whether or not it is cleared from recent apps) and then re-opened, then a new instance of the listener gets registered, while the previous ones still persist. Therefore, each new SMS starts triggering all registered receivers.

(2) Even though registered receivers persist across closing / re-opening of app, they don't respond if the app has been closed (doesn't matter whether or not it is cleared from recent apps). That is even though the registered receivers are alive, they don't get triggered until the app is in the foreground.

While the first limitation above could be handled by simply unregistering the listener before the app closes (which function do i invoke for doing that?), the 2nd limitation seems more inhibiting and seriously confines the usage of package.

thiennhank9 commented 7 years ago

Sorry but does anyone still got message now, because i have recently coded new project and now it don't receive any message! T_T

andreyvital commented 7 years ago

Hey guys I need to investigate what's going on. Appreciate your thoughts and your time for reporting this!

thiennhank9 commented 7 years ago

Tks Centaur so much for supporting, now it's all resolved! :D

vjcoder33 commented 7 years ago

@CentaurWarchief Thanks for the package.

I tried the library.

Works fine when the app is opened but when its closed messages are not listened.

andreyvital commented 6 years ago

hey @vijayperlakota sorry for the delay. Yes, this is a known issue. Eventually, I'll get it fixed. You can read my answer here.