stfalcon-studio / SmsVerifyCatcher

Android library for phone number verification feature in your app. Automatically copies verification code from SMS right into the app. Made by Stfalcon
https://stfalcon.com
845 stars 181 forks source link

It's not work #9

Closed xinshengBoy closed 6 years ago

xinshengBoy commented 7 years ago

My phone is 6.0 version, I can accept sms,but app isn't work

abhay222 commented 7 years ago

can you show your code snippet

praveen2gemini commented 7 years ago

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.

abhay222 commented 7 years ago

just comment out this line from your activity smsVerifyCatcher.setPhoneNumberFilter("");

praveen2gemini commented 7 years ago

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 ?

abhay222 commented 7 years ago

I didn't mean make it empty string. I said comment out this line.

praveen2gemini commented 7 years ago

Yeah Got it. What I want. It works. Great! @abhay222