darryncampbell / react-native-datawedge-intents

React Native interface for Zebra's DataWedge Intent API
MIT License
43 stars 46 forks source link

Can't detect available scanners neither get data after scanning #26

Open sebas0811buitrago opened 2 years ago

sebas0811buitrago commented 2 years ago

First of all thanks for your library, It'll be really helpfull for me when I make it work.

I'm trying to build a qr scan app with your package and it can't get the available scanners neither retrieve any data when I press the scan button. This is what I did so far:

  1. First thing I did was to run your git hub repository and it worked as expected, it show the availables scanners and also if I press the button scanner it retrieves data as you can see here:

image

  1. Then I init a react native project from zero and installed your npm package but I get this, It doesn´t list the available scans and neither retrives data when I press the scan button but The scanner beam emits though , here is a screenshot of what I got:

image

  1. I read the issue Can't seem to recieve intent and changed this "PACKAGE_NAME": "com.rn066datawedge"but it didn't work.

These are the versions of my dependencies:

    "react": "17.0.2",
    "react-native": "0.66.3",
    "react-native-datawedge-intents": "^0.1.8",
    "react-native-elements": "^3.4.2"

This is a repository with my code: repository

Maybe Do I have to change something in my manifest or graddle? Do you have any insight here?

Thanks in advanced.

sebas0811buitrago commented 2 years ago

Sorry I just realize that this line "PACKAGE_NAME": "com.rn066datawedge" had to have the name of my package, I changed and it worked, now it retrieves the scanned data, however it doesn´t get the available scanners but I don´t know why.

darryncampbell commented 2 years ago

Hi, so to retrieve responses back from the DataWedge API (which is how the available scanners are delivered), you will need both the correct action, RESULT_ACTION, the same as https://github.com/darryncampbell/DataWedgeReactNative/blob/master/App.js#L100 and also you need to specify the default category, https://github.com/darryncampbell/DataWedgeReactNative/blob/master/App.js#L103. After registering your receiver, calling enumerate (https://github.com/darryncampbell/DataWedgeReactNative/blob/master/App.js#L163) should result in the scanners being returned as https://github.com/darryncampbell/DataWedgeReactNative/blob/master/App.js#L135. Please check that you have all of those in your application.