Closed xinshengBoy closed 6 years ago
can you show your code snippet
This is not working for me also. I just created HelloWorld project. Just tried your changes. It's not working. Even I tried with your sample. Probably Issue may happen with the mobile number. Inside "SmsReceiver" class please a Log to put whatever message received. Then If the received number not matched with ours then skip it.
Log.e("SmsReceiver", "SMS received from: "+phoneNumber); // Please add this line.
if (phoneNumberFilter != null && !phoneNumber.equals(phoneNumberFilter)) {
return;
}
Because If the problem with our number we can identify our side issues. OTP number some time will be DM-878*** some numbers, some time 10 digit mobile numbers.
just comment out this line from your activity smsVerifyCatcher.setPhoneNumberFilter("");
If I do as you said, How It will work?
If I set smsVerifyCatcher.setPhoneNumberFilter("");
then phoneNumberFilter = "";
if (phoneNumberFilter != null && !phoneNumber.equals(phoneNumberFilter)) {
return;
}
Here phoneNumberFilter != null will be true but !phoneNumber.equals(phoneNumberFilter)
will fail. Because ! "DM-878899".equals("")
Isn't it ? Isn't it ?
I didn't mean make it empty string. I said comment out this line.
Yeah Got it. What I want. It works. Great! @abhay222
My phone is 6.0 version, I can accept sms,but app isn't work