neo9 / cordova-honeywell-scanner

Honeywell TC50/D75E Barcode Scanner and external device using the com.honeywell.aidc SDK
7 stars 8 forks source link

Ionic 2 implementation problem #1

Open kumawatankur opened 6 years ago

kumawatankur commented 6 years ago

I Have complete implement in cordova but Ionic 2 Not implement because no nay method for ionic 2. In you git hub provide only cordova example. Please provide a ionic methods. and app.modules.tc file import path. Thankyou

vidz1979 commented 6 years ago

I need it too!

kumawatankur commented 6 years ago

ThankYou for reply, How to implement in Ionic 2? Please guid. I Still waiting for your response. ThankYou

On Sat, Jun 23, 2018 at 10:32 PM Junior Vidotti notifications@github.com wrote:

I need it too!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neo9/cordova-honeywell-scanner/issues/1#issuecomment-399693316, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdmZBZIzVDvjWu3BEEllKumTHe6-umLks5t_nSdgaJpZM4TJf1- .

gaetansenn commented 6 years ago

Hello everyone,

This is a cordova plugin which can be easily used with ionic 2.

Just follow this tutorial : https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/

Regards,

kumawatankur commented 6 years ago

Hello, ThankYou for your response. I know that how to use plugin in ionic 2. But Honeywell plugin and npm installation and cordova all most plugin not working in ionic 2. Some method create in javascript but did not work in typescript. So please provide a solution.

I waiting for your response. ThankYou

On Mon, Jun 25, 2018 at 1:57 PM Gaetan SENN notifications@github.com wrote:

Hello everyone,

This is a cordova plugin which can be easily used with ionic 2.

Just follow this tutorial : https://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native/

Regards,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neo9/cordova-honeywell-scanner/issues/1#issuecomment-399873087, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdmZMbOeu5mq-aT0rrkn1GhVFQhPGkTks5uAJ74gaJpZM4TJf1- .

gaetansenn commented 6 years ago

Hello,

You need to add the library as mentioned in the README:

ionic cordova plugin add @neo9/cordova-honeywell-scanner

Once the plugin added to your project you will have to be sure that you are calling this function on a device with this conditional :

from your constructor include the Platform component:

import { Platform, ... } from 'ionic-angular'

constructor(private platform: Platform...) { ... }

and where you are calling your function

if (this.platform.is('cordova')) {
  (<any>window).cordova.plugins.honeywell[YourFunction](arguments...)
}

Regarding what you said about the compatibility with ionic 2 and typescript, there is no problems as this is a javascript library that is injected in the Window Object of your app.

Please provide more details of your problem in the future,

Regards,

kumawatankur commented 6 years ago

ThankYou for your response, Okay I try this. When the problem comes then i mail you.

Regards

On Mon, Jun 25, 2018 at 9:04 PM Gaetan SENN notifications@github.com wrote:

Hello,

You need to add the library as mentioned in the README:

ionic cordova plugin add @neo9/cordova-honeywell-scanner

Once the plugin added to your project you will have to be sure that you are calling this function on a device with this conditional :

from your constructor include the Platform component:

import { Platform, ... } from 'ionic-angular'

constructor(private platform: Platform...) { ... }

and where you are calling your function

if (this.platform.is('cordova')) { (window).cordova.plugins.honeywellYourFunction }

Regarding what you said about the compatibility with ionic 2 and typescript, there is no problems as this is a javascript library that is injected in the Window Object of your app.

Please provide more details of your problem in the future,

Regards,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neo9/cordova-honeywell-scanner/issues/1#issuecomment-399995120, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdmZMEpX3d7E_59TolBQHsUrqo_S__Uks5uAQMUgaJpZM4TJf1- .

bvprogramit commented 6 years ago

Hi,

I had the same problem. I am using ionic framework and you do not need to import the plugin, just install it with the following line:

$ ionic cordova plugin add @neo9/cordova-honeywell-scanner

Once it is installed you will see the folder com.neo9.cordova-honeywell-scanner under the plugins folder on your project.

Then you need to declare a variable named cordova. See my scanner ts file below:

import { Component } from '@angular/core'; import { Platform } from 'ionic-angular';

declare var cordova: any;

@Component({ selector: 'page-scanner', templateUrl: 'scanner.html', }) export class ScannerPage { constructor(public platform: Platform) { platform.ready().then(() => { cordova.plugins.honeywell.listConnectedBarcodeDevices((result) => { result.devices.forEach((device) => console.log(name: ${device.name}, id: ${device.id})); }, (err) => { console.log('yayyyyy an error!!!!'); console.error(err); }); }); } }

With the following line:

$ ionic cordova run android --device

You can install your app on your device and test, just make sure that in your package.json you are using "cordova-android": "6.4.0"

Hope this helps. Thanks.

kumawatankur commented 6 years ago

ThankYou very much for reply. I have tried after i informed you.

On Fri, Jul 13, 2018 at 7:47 PM blovable notifications@github.com wrote:

Hi,

I had the same problem. I am using ionic framework and you do not need to import the plugin, just install it with the following line:

$ ionic cordova plugin add @neo9/cordova-honeywell-scanner

Once it is installed you will see the folder com.neo9.cordova-honeywell-scanner under the plugins folder on your project.

Then you need to declare a variable named cordova. See my scanner ts file below:

import { Component } from '@angular/core'; import { Platform } from 'ionic-angular';

declare var cordova: any;

@component https://github.com/component({ selector: 'page-scanner', templateUrl: 'scanner.html', }) export class ScannerPage { constructor(public platform: Platform) { platform.ready().then(() => { cordova.plugins.honeywell.listConnectedBarcodeDevices((result) => { result.devices.forEach((device) => console.log(name: ${device.name}, id: ${device.id})); }, (err) => { console.log('yayyyyy an error!!!!'); console.error(err); }); }); } }

With the following line:

$ ionic cordova run android --device

You can install your app on your device and test, just make sure that in your package.json you are using "cordova-android": "6.4.0"

Hope this helps. Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neo9/cordova-honeywell-scanner/issues/1#issuecomment-404846680, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdmZGk13MwtQlE81vVssPqpSpXO0s_Yks5uGKv1gaJpZM4TJf1- .