Closed davidpadych closed 4 years ago
Hi, is this reproducible with the Zebra Ionic Demo at https://github.com/Zebra/ZebraIonicDemo ?
Code looks the same and dependecy (your plugin) too... I can try to build this project and test it
Please do and if you can reproduce with the demo app then I'll take a look. I definitely have not seen this before but it could be related to versions / device / Operating system or any number of variables.
I've been able to reproduce the bug even on the application ZebraIonicDemo...
just get 20 different barcode (code128) and load them fast ... 2x to read the new code read the previous (see screenshots)
DataWedge App version 6.6.49 Android 7.1.2 Zebra TC25
I don't see the same with a TC25 here, it is running DataWedge 6.7 but that should not make a difference. Is it possible you are scanning the same barcode twice inadvertently? Perhaps enable Picklist mode in your DataWedge Profile (Barcode Input --> Reader Params --> Picklist --> Software), then only the barcode below the reticle will be decoded.
I really did not scan the same code twice... I try the settings in the datawedge profile.
even after setting up a Picklist - Software, same behavior ...
I've also tried this plugin (https://github.com/BlueFletch/motorola-datawedge-cordova-plugin) and the behavior is the same.
It must be somewhere in setting up that DataWedge profile. DWDemo (DataWedge demo app) uses the Intent Output -> Intent delivery -> Send via startActivity and duplicates are not used.
I use Broadcast intent just like ZebraIonicDemo, otherwise the setting looks exactly the same.
You should be able to use the getIntent() method of this plugin to retrieve the Intent sent by StartActivity, if that is an option for you
and how to use it? Every time I run an app, getIntent () performs only once ... nothing happens after every code is scaned.
Or onIntent(). There are examples of use in the read me: https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent
Thanks, maybe I'm good with some solution.
Another idea worth trying out might be to always use NgZone.run() in the receiving event. Like:
import {NgZone} from '@angular/core';
constructior(public zone: NgZone) {
}
private registerBroadcast() {
console.log('register broadcast intent');
window['plugins'].intentShim.registerBroadcastReceiver({
filterActions: ['cz.myapp.scanner', 'com.symbol.datawedge.api.RESULT_ACTION'],
filterCategories: ['com.android.intent.category.DEFAULT']
},
(intent) => {
this.zone.run(() => {
console.log('received intent: ', intent.extras);
if (intent.extras['com.symbol.datawedge.data_string']) {
this.events.publish('reader:barcode', intent.extras['com.symbol.datawedge.data_string']);
}
});
}
);
Can this be closed?
Hello,
i apologize for my English... i am using your plugin with Data Wedge profile (set according to your blog post).
Everything works as it is, scans the codes, and I come across a case where sometimes (possibly between 2 different codes) when I do it so quickly (<2s) the received intent (barcode) is the same as the previous one.
I do not know what I am doing wrong? is it possible that there would be some cache, for example, in setting a date wedge profile or some timeout?
thank you for any help :)
Version: com-darryncampbell-cordova-plugin-intent 1.1.5 Ionic 3.7.1 HW: Zebra TC-25 (Android 6.0)
Code (typescript):