Search code examples
react-nativereact-native-iosbarcode-scanner

How to call react-native function from IOS native module(Plugins)


I want to call react-native function from native module.

I have created one barcode-scanner plugins for my react-native app, barcode-scanner SDK is available in native IOS & Android so, i extract those native code and create one plugins(NPM) for react-native app.

Now my problems is, Once barcode-scanner scan a data and send to native IOS, how can i get those scanning data in my react-native app ?(I got scanned data in IOS native)

I want to call react-native app function once native module scanned a data and send those data in react-native

Please give example or proper document so i can try and implement.

Thanks in advance.


Solution

  • I have used "RCTDeviceEventEmitter" & "NativeEventEmitter" and add listener for received event

    more detail