Unable to read sms Using Broad cast receiver from OREO

303 Views Asked by At

Reading Otp from SmsManager and update the text feild Automatically.

I followed below article

Automatically-read-OTP from SMSes — Android 4.3 to 8.x by STYLABS https://link.medium.com/sk22tU4qTR

I'm facing issue while implementing.. It works below Oreo versions 8.0 .

From Oreo version Broadcast receiver is not triggering.

Because of Doze Mode broadcast receivers are not triggering.But it's working till nougat version.

Alternative is SMS Retraival API from Google .But I don't want to go with that currently .

How to do this ? It is not triggering Once the sms is received to phone .

1

There are 1 best solutions below

0
On

Yes After OREO update You can not read SMS by READ_SMS permission.

Don't worry,

You can replace :

READ_SMS permission with RECEIVE_SMS

Now Oreo as well as other version also be able to read the SMS.