-1

I am looking for a potential hack in my application where I am unable to get the onReceive() or SMS_SENT or SMS_DELIVERED in devices like Oppo, Vivo, Mi.

A message is sent from my device and I register a receiver to listen for the status of the message, sent and delivered, after that, I will do some networking calls.

Currently, my app is unable to get the onReceive(). Why? Because I add value to an Array every time my onReceive() gets called and send to the server. I am getting an Empty Array for devices like Oppo, Vivo, Mi.

How can I track this this or at least reproduce it?

Is there an app or any setting that could delete or cancel the broadcast and prevent reaching my phone?

halfer
  • 19,824
  • 17
  • 99
  • 186
Aman Verma
  • 3,155
  • 7
  • 30
  • 60

1 Answers1

0

Can you confirm, so it is not calling onReceive or the Intent data parameter is returning null of the onReceive method? Can you try the following?

Send SMS until it is successful

halfer
  • 19,824
  • 17
  • 99
  • 186
rohan ghosh
  • 159
  • 6
  • My onReceive is not getting called. There are two receivers, one for SMS_SENT and other for SMS_DELIVERED. In SMS_SENT if the resultcode is not Result_OK then I am adding it to array(which is send to server), In SMS_DELIVERED, I am adding to the array for each case like( Result_OK and Result_Canceled). So, in Logs I checked that I am getting array Empty. I think I might get REsult_OK in SMS_SENT and I am not getting SMS_DELIVERED receiver or onReceive is not getting called. " the Intent data parameter is returning null " is this possible in SMS_SENT and SMS_DELIVERED? – Aman Verma Jan 13 '21 at 17:07
  • Can you try to put debugger in the receive and see what you are getting? Also please make sure services are already declared in the manifest file. – rohan ghosh Jan 14 '21 at 07:48