faizalshap / react-native-otp-verify

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

new NativeEventEmitter() was called with a non-null argument without the required addListener method #74

Open doublex opened 1 year ago

doublex commented 1 year ago

Running the code on ios, this yellowbox-warning pops up:

new NativeEventEmitter() was called with a non-null argument without the required addListener method

Maybe: https://stackoverflow.com/questions/69538962/new-nativeeventemitter-was-called-with-a-non-null-argument-without-the-requir

dinchen-tally commented 1 year ago

This is mainly because of

const eventEmitter = new NativeEventEmitter(RNOtpVerify);
https://github.com/faizalshap/react-native-otp-verify/blob/master/src/index.tsx in line 21. May be this function should be called conditionally based on platform if it is ios/android

mertafor commented 1 year ago

This happens since RN 0.71 and still the latest version throws this error. Is there any progress on this one for the next release?