SMS Broadcast Receiver not working

前端 未结 4 1661
不知归路
不知归路 2021-01-23 08:33

Alright, I have tried every solution on Stack and nothing works.My current method registers the \"SmsListener\" receiver from the MainActivity. All I\'m trying to do is initiali

4条回答
  •  渐次进展
    2021-01-23 08:55

    You are registering broadcast your in your Activity, so it won't work if your app is in background. you can remove this from your Activity and you can register it in Manifest.

    ex:

     
        
            
        
    
    

    Along with this add permission to recieve sms.

    Try this, and it will work

提交回复
热议问题