faizalshap / react-native-otp-verify

React native sms verification without additional permissions
MIT License
239 stars 92 forks source link

Not working on Android 14 #105

Closed zhekix closed 6 months ago

zhekix commented 7 months ago

Hello everyone!

We have updated React Native to version 0.73.2. We are using react-native-otp-verify version 1.1.6. We have noticed that the library has stopped intercepting OTP codes. What could be the reason? Has anyone else encountered this issue before?

Best regards, Yauheni

zhekix commented 7 months ago

Any ideas, maybe tricky workaround ?)

ajiehatajie commented 7 months ago

same issue in android 14, cannot read sms in listener method

faizalshap commented 7 months ago

I haven't tested recently in the Android 14, Anyone has any pointers so far?

androideveloper commented 7 months ago

You can patch this line to make it work with android 14.

https://github.com/faizalshap/react-native-otp-verify/blob/07334dedd1ba21c945ae04f977c09ff272591d02/android/src/main/java/com/faizal/OtpVerify/OtpVerifyModule.java#L119

example https://github.com/wix/react-native-navigation/pull/7801/files

pgim03 commented 6 months ago

Same problem, someone was able to fix it?

jerearaujo03 commented 6 months ago

This PR fix the issue

ajiehatajie commented 6 months ago

This PR fix the issue

execellent

pgim03 commented 6 months ago

This PR fix the issue

In my case I still have a problem, I am working with version 0.72.3 of react native, java 17 and react-native-otp-verfify 1.1.6.

It does not find references to those values.

Captura de pantalla 2024-01-31 a la(s) 10 42 47 Captura de pantalla 2024-01-31 a la(s) 10 43 41 Captura de pantalla 2024-01-31 a la(s) 10 43 58

They are being imported from

import android.content.Context; import android.os.Build;

jerearaujo03 commented 6 months ago

I'll take a look

pgim03 commented 6 months ago

I'll take a look

My team and I have come to the conclusion that compileSdkVersion must be modified safeExtGet('OtpVerify_compileSdkVersion', 34) and there it recognizes all the values.

Tests were carried out and it works on Android versions 13 and 14.

In case anyone else has the problem, they can try that.

It would be good to create a PR to fix the root problem.

Thanks for the follow up.

Captura de pantalla 2024-01-31 a la(s) 13 59 17 Captura de pantalla 2024-01-31 a la(s) 14 02 32
jerearaujo03 commented 6 months ago

You can check #106

jerearaujo03 commented 6 months ago

Meanwhile you can use this patch:

react-native-otp-verify+1.1.6.patch

faizalshap commented 6 months ago

Fixed in v1.1.8