infoxicator / react-native-star-prnt

React-Native bridge to communicate with Star Micronics Bluetooth/LAN Printers
MIT License
67 stars 65 forks source link

Undefined is not an object(RNStarPRNT.portDiscovery) #1

Closed AlicanAkyol closed 6 years ago

AlicanAkyol commented 6 years ago

Hello, I want to use StarPRNT module and I tried your example function but I get the error.

`import { StarPRNT } from 'react-native-star-prnt';

async function portDiscovery() { try { let printers = await StarPRNT.portDiscovery('All'); console.log(printers); } catch (e) { console.error(e); } }`

infoxicator commented 6 years ago

Hi @AlicanAkyol sounds to me like the Native side of the plugin is not installed properly and it is not loading the native bridge, are you using Android or iOS?

AlicanAkyol commented 6 years ago

Thanks for replying @infoxicator . Firstly I want to use on Android. How do you understand cause of the error?

infoxicator commented 6 years ago

Hi @AlicanAkyol Try reinstalling the plugin and make sure you run react-native link react-native-star-prnt The android linking should happen automatically, if not let me know the version of RN and Android

AlicanAkyol commented 6 years ago

Hi @infoxicator . I tried it again and again but I didn't run the project.

infoxicator commented 6 years ago

@AlicanAkyol If this is a new project try deleting the android folder and installing again, if not try creating a brand new project and link the Plugin. Also, please let me know the version of Android and RN