BlueFletch / motorola-datawedge-cordova-plugin

This is a Cordova/Phonegap plugin to interact with Motorola ruggedized Android devices' Barcode Scanners and Magnetic Stripe Readers (eg, ET1, TC55, MC40). The plugin works by interacting with the "DataWedge" application configured to output scan and magstripe read events.
35 stars 38 forks source link

Not getting callback in datawedge.registerForBarcode event in Datawedge plugin #13

Open Rishitosh opened 8 years ago

Rishitosh commented 8 years ago

Hi,

Requirement:

I am using Motorola's T70 Device and we are making a hybrid application using HTML5+CSS with Javasript framework angular JS and stuck in scanning realated activity. We want to get the scanned value without tapping on input field (textbox).

Issue:

I am not able to get the callback in datawedge.registerForBarcode event in Datawedge plugin. Any help would be appriciated. Thanks in advance.

What we implemented yet

To implement the barcode scanning functionality in the device we are using the Datawedge Plugin and after installation of plugin we are not getting the scanned value in callback event (datawedge.registerForBarcode) when user scan the barcode.

Below are the extra details and information

Device : Motorola T70 Barcode scanner Scanning Framework: 3.0..38 Datawedge App in device(T 70) version : 2.1.7 Profile we are using in Device: Default Profile Motorola Cordova Plugin: 0.1.0 Plugin ID: com.bluefletch.motorola

Code related details:

document.addEventListener('deviceready', function () {
if (window.datawedge) {

        datawedge.start(); //uses default

    }

    datawedge.registerForBarcode(function (data) {
        var labelType = data.type,
            barcode = data.barcode;
    });

}, false);

//We have configured the same action in the datawedge default profile as mentioned below and also put the blank in the category option. //Plugin.xml

//AndroidManifest.xml

rchovan commented 8 years ago

Hi, I have exactly same problem. Is there any solution for this ?

rmakerson3 commented 8 years ago

Have you tried to create a new profile and add your application to the data wedge profile? I believe the default (Profile0) will not allow this and you are required to create a new profile.

rchovan commented 8 years ago

Hi, solved by https://github.com/BlueFletch/motorola-datawedge-cordova-plugin/issues/5#issuecomment-56745933

Thanks.

chaitanyaatkuri commented 7 years ago

Rishitosh ... Are you able to figure out an answer to this? If not, I will try helping you.

I predict the reason for not getting callbacks to your application is that your application is not registered with the default "DataWedge" app on your device.

To register, 1) Open the datawedge app. 2) Create a new profile by clicking on the menu app. 3) Give it any name of your choice probably your app name. 4) Now profile creation is done, now your need to register your app with that profile. 5) Now click the profile created and select the "Associated apps" in the list. Now select your app from the list of all apps installed on your device, also choose your class in which you have this code usually MainActivity. 6) Now come back to the list of items and disable Keyboard input. 7) Enable Intent output.

Run your app now. Now the callbacks should trigger through the callback provided in the readme code.

Hope it helps