@mhartington
Please find the changes that I made in the code
this is how i am calling in my current code to invoke the printer after the suggested changes
this.platform.ready().then(() => {
ZPLPrinter.print(ip, bclables,
function (success) {
alert(success);
}
,
function (fail) {
alert('fail');
});
});
however I still see the error Error TS2304: Cannot find name ‘ZPLPrinter’.
Did I miss anything else ?
So there were a few things missing in your example project.
I ended up forking the repo, and sending a PR your way.
The changes are pretty minimal, but the overall idea is that you declare the module in you class, the give it a type that matches your definition file.
declare var ZPLPrinter: ZPLPrinter;
Thanks @mike that was a great help from you. Will test it on ios and andriod and let you know if we have any issues.
@mhartington mike We got the following issue…please find the error below.
@mhartington I see some code changes in github,is the issue resolved?
sisdemo
November 22, 2016, 6:19am
27
Hi @lthh89vt ,
I am new to Ionic,
I’m using Ionic2 with typescript, and I didn’t manage to use this plugin : https://github.com/card-io/card.io-Cordova-Plugin
Can you share how could you hack this?
What need to included in the source code?
Thanks,
Punleu
sisdemo
November 22, 2016, 6:29am
28
hi @stirumala ,
Have you found solution for this?
I am having the same issue with https://ionicframework.com/docs/v2/native/cardio/
I’ve been searching for few days. I am still not able to use this plugin in Ionic2.
Thanks,
Punleu
Are you testing this in chrome test lab or phone…?
haven’t tried but these are my initial thoughts for you in case if you haven’t done these
create sample poc
configured the pluigin in your ionic app and put an alert message in plugin code to see the card reader value as given in the doc, make sure u install the pluin in ur app
https://ionicframework.com/docs/v2/native/cardio/
deploy on phone android or IOS , I believe this plugin doesn’t work test lab, should deploy apk - android and ipa on ios .
hook up the card reader scan to your phone.
you can debug the app using android phone with chrome debug
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
good luck!!
sisdemo
November 22, 2016, 3:55pm
30
Hi Stirumala,
I got this fixed already. It’s the issue with Ionic View.
The solution is install the APK on the device.
I have try adding CardIO plugin into my IONIC2 app, but I could not manage to get it working.
I try to test on Ionic View in my device, and it doesn’t work.
ionic start myproject --v2 --ts
then I follow Plugin: https://ionicframework.com/docs/v2/native/cardio/
then I run "ionic serve -l
The app is crash and this is the error message “caused by: No provider for CardIO!”.
Can anyone suggest what I do to test this cardIO?
Thanks,
Punleu
Thanks,
Punleu
hi Mhartington,
Cant you make any video demonstrating from scratch such that i can understand as i am a new bye to this development environment
Thanks
Vishu
Hello if somen here got the error:
error TS2339: Property 'plugins' does not exist on type 'Window'.
Try like this:
(<any>window).plugins.somePlugin.doSomething();
subbut
March 13, 2018, 11:34am
33
declare let cordova: any;
this.platform.ready().then(() => {
var success = function(result) {
alert(JSON.stringify(result, undefined, 2));
}
var failure = function(result) {
alert(JSON.stringify(result, undefined, 2));
}
cordova.plugins.pluginname.method(message,success,failure);
});
Once you added plugin to your project, go to the file (.ts) in which you want to use the plugin.
Then follow the steps given below
declare var yourplugin;
yourplugin.doSomething()
This helps me to call the method doSomething() in yourplugin.
1 Like
Excuse me, I’m really new here,where is the name of the file or the directory that I need to write the import section.