darryncampbell / DataWedgeReactNative

Demo app to show how to access Zebra's DataWedge with React Native
https://developer.zebra.com/community/home/blog/2018/10/29/developing-react-native-applications-on-zebra-devices
MIT License
40 stars 13 forks source link

React Native example with functions/hooks instead of classes. #18

Closed cmnstmntmn closed 3 years ago

cmnstmntmn commented 3 years ago

Hey, i'm trying to setup a demo using react and a zebra TC57.

Is there such a code snippet using hooks instead react classes?

ty

darryncampbell commented 3 years ago

Hi, I had to look up what hooks were as I am not a "native" React native developer :( To answer your question, no, I'm afraid not as I wrote the app in September 2018 and hooks were introduced in React 16.8, released February 2019.

cmnstmntmn commented 3 years ago

i manage to make de RN demo app to work, however i lost 8 hrs without any luck with my own integration. i mean, i'm receiving the intent, but no data and also the hard key press has no effect.

this line

'com.zebra.reactnativedemo.ACTION'

should be replaced with

'com.zebra.myapp.ACTION'

right?

darryncampbell commented 3 years ago

The ACTION you are registering to receive must match the ACTION that DataWedge is configured to send you, so if you are listening for com.zebra.myapp.ACTION you need to configure the DataWedge Intent output to match that: See here