Comments (7)
@soganideepak here is example code for ionic 2 after install plugin:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
declare let BTPrinter: any;
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {
}
public print(): void {
BTPrinter.list((data) => {
console.log('Printers list:', data);
}, (err) => {
console.error(`Error: ${err}`);
});
}
}
from cordova-plugin-bluetooth-printer.
Hi, @soganideepak ionic2 with typescript or javascript?
from cordova-plugin-bluetooth-printer.
Thanks for providing the help. Now it's work for me.
from cordova-plugin-bluetooth-printer.
Hi this is munichandra when i install the plugin it throwing error
from cordova-plugin-bluetooth-printer.
Could somebody please let me know, why it's not working with my Ionic project? I just created a test project to test the plugin.
https://github.com/OliverTr54/bletest.git
I did some alerts to figure out, if the function is started or not, but after the first alert - executing the BTPrinter.... I get no other alert anymore, neither on success or error :( What am I doing wrong?
I use Ionic 3:
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.8
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : none
Ionic Framework : ionic-angular 3.4.2
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
I currently test my development by using Ionic View.
from cordova-plugin-bluetooth-printer.
i'm also not able to download the plugin, it gives me following error:
printer Abhi$ cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git
Error: Failed to fetch plugin https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hardikjani/.npm/_logs/2017-07-29T10_38_32_042Z-debug.log
Hardiks-Mac-mini-2:printer Abhi$ ionic cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git
cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git --save
β Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova plugin add
https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Print... (exit
code 1):
Error: Failed to fetch plugin
https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git via
registry.
Probably this is either a connection problem, or plugin spec is
incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! A complete log of this run can be found in:
npm ERR!
/Users/hardikjani/.npm/_logs/2017-07-29T10_40_07_824Z-debug.log
Hardiks-Mac-mini-2:printer Abhi$ ionic cordova plugin add Cordova-Plugin-Bluetooth-Printer
cordova plugin add Cordova-Plugin-Bluetooth-Printer --save
β Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova plugin add
Cordova-Plugin-Bluetooth-Printer --save (exit code 1):
Error: Registry returned 404 for GET on
https://registry.npmjs.org/Cordova-Plugin-Bluetooth-Printer
from cordova-plugin-bluetooth-printer.
Hi @soganideepak I have followed the same instructions but still getting error at console BTPrinter is undefined. Please could you help me verifying how can I check if plugin is installed properly. I have added the plugin to config.xml and I can see it on Cordova Plugin List command. Do I need to add any javascript ref? or will it work on browser to check?
Thanks in advance.
from cordova-plugin-bluetooth-printer.
Related Issues (20)
- δΉ±η HOT 1
- Connection Time Out Error HOT 1
- unable to add plugin HOT 2
- I am getting Socket Closed isuue
- Can't reduce margin during image print
- How to cut paper? HOT 1
- How to get bluetooth devices ID HOT 1
- Result of printing image base64 HOT 33
- How to use this plugin on android code Java.
- Not printing in english HOT 1
- Text align HOT 1
- Can't install HOT 3
- Printer not disconnected (random)
- Print by Mac Address
- Connect to zebra printer and print success but not printing data
- [INFO] DO NOT USE THIS PLUGIN, IT IS OUT OF MAINTENANCE, USE THIS OTHER
- cash drawer command is not working
- how can i use this on phonegap?
- ionic4 or 5?
- How to Import ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-bluetooth-printer.