Closed sergeykotor closed 3 years ago
https://snack.expo.io/@sergeykotor/8f9ff2 source, but i dont use expo, just for show
Thanks for sharing, I have a few questions / points:
Thanks for answer!
@darryncampbell I built your application and now it seems to work correctly
That is so strange. Could it be that you are running in debug and something to do with hot reload causing multiple broadcast receivers (or observers?) to be registered without unregistering the previous ones, that would explain why you are getting inconsistent behaviour and the multiple scans, though would not explain the app reloading behaviour.
I see a genericReceiver
object that is not unregistered in the onHostPause()
method, that could be the root cause. I also see a comment at https://github.com/darryncampbell/react-native-datawedge-intents/blob/master/android/src/main/java/com/darryncampbell/rndatawedgeintents/RNDataWedgeIntentsModule.java#L100 saying this is expected behaviour... it has been a long time since I looked at this code but it looks as though there was some discussion on how it should work when I first implemented it - that could be the root cause of what you are seeing but if I'm right, and this is related to hot reload, this would only be seen during development.
@darryncampbell Thanks for the answer! Maybe this is really hot reload. And I noticed another bug in the builded version, after several scans (10-15) new barcodes are not added to the beginning of the list.
in the builded version, after several scans (10-15) new barcodes are not added to the beginning of the list.
That would definitely be some problem with my app rather than the Intent plugin - I add the scan to the array at https://github.com/darryncampbell/DataWedgeReactNative/blob/master/App.js#L259, I guess there is something wrong with that logic
@darryncampbell Please, sorry about offtop! Сan android 5.1 with gms be installed for my tc70 TC700H-KC11ES-IN android 4.4 without gms?
@sergeykotor Yes, you can (the link to the download is https://www.zebra.com/us/en/support-downloads/software/operating-system/tc70-operating-system.html) but you need to have a support contract or some other eligibility to download the image. If you don't have those then there is a 'contact support' button in the top right hand corner.
Once you have access to the download, follow the instructions in the ReadMe and be aware of step 5g:
Next step only if you are switching between GMS and NON-GMS software, otherwise this
step is not required.
• If you are updating device from GMS to NON-GMS or Vice Versa, it is required to
either use T70N0LXXARFXX21002.zip (Factory Reset Package v02.10.02) (Factory
Reset, this will give complete OOB experience) or at Minimum, please do a
T70N0LXXAREXX21002.zip (Enterprise Reset Package v02.10.02)
I need these files? Because i can download without support contract now.
Yes, that is right. Install the Full Software Update, Factory Reset, then the Mandatory Patch, then the latest Lifeguard release (17). Instructions should be in the readme but in short:
Note, all data on the device will be lost when you Factory Reset!!!
@darryncampbell Thank you! I am grateful for your advice.
I updated android, installed liveguard update, and now all problems (with debugging, double scanning, etc.) are gone. Thank you again
The problem with multiple scans is still present, it appears if you make code edits in the debug.
There is a bug in the sample app, you will need to unregister / reregister the event emitter during a reload, like this:
componentDidMount()
{
this.state.deviceEmitterSubscription = DeviceEventEmitter.addListener('datawedge_broadcast_intent', (intent) => {this.broadcastReceiver(intent)});
this.registerBroadcastReceiver();
this.determineVersion();
}
componentWillUnmount()
{
this.state.deviceEmitterSubscription.remove();
}
@darryncampbell I've done this before, and it didn't help
@darryncampbell I downloaded the project from the git again and now the logs are working normally, but at start is sends a signal that a scan has occurred. Some kind of intent not related to the scanner comes https://github.com/darryncampbell/DataWedgeReactNative/blob/a915464dff023b7b276e9fee3354618e7e3521ef/App.js#L140
Strange, I could not reproduce that "Scan: undefined" message - do you just launch the app and then see it or are there other reproduction steps?
I launched the application after a few days and the error disappeared. Maybe it was my problem.
Hello! In the debug mode, when scanning the date matrix codes, it is reloaded. There is also the problem of double scanning, when the scanner does not go into disabled mode immediately, but only after the second scan. And if it turns out to be scanned once, then two entries are displayed in the console. React version 0.63, device TC70