Closed nazarTrynko closed 7 years ago
Can you share a code snippet of how you're using it?
I tried to put it in componentDid/WillMount
componentDidMount() { SmsListener.addListener(message => { console.log(message) }) }
and before component:
import SmsListener from 'react-native-android-sms-listener
SmsListener.addListener(message => {
console.log(message)
})
export default class SmsView extends Component {
Right. I'll try to troubleshoot/reproduce this later.
Thanks! Looking forward to hearing from you!
@nazarTrynko What's your RN version?
@julianocomg 0.43
@nazarTrynko I've tested with 0.44.1 with no problems (but the API of these two versions is the same). Please, remove the module from your project, including via npm, and execute the following commands:
Try again, and give us a feedback
@julianocomg thank you for response. I tried your approach, but unfortunately it didn't help =(
I also see that EmitterSubscription does not have context and _currentSubscription. Maybe something about those is wrong
Hi nazarTrynko,
After include everything like in guide, have you sent an SMS through telnet protocol? When a SMS arrives to your phone then the listener acts and you can see your console.log
@lmmaeso Hi, well, I used sms simulation from AVD emulator extended control and also tried it with real sms on my device
Okay, so the solution was just to add permission for sms for application in Settings => Apps. Cheers =)
🍻
Hi! I have added everything like in guide, added listener to my view, but it does not enter listener's callback