Git Product home page Git Product logo

Comments (7)

ssarnot avatar ssarnot commented on September 18, 2024 1

@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.

srehanuddin avatar srehanuddin commented on September 18, 2024

Hi, @soganideepak ionic2 with typescript or javascript?

from cordova-plugin-bluetooth-printer.

soganideepak avatar soganideepak commented on September 18, 2024

Thanks for providing the help. Now it's work for me.

from cordova-plugin-bluetooth-printer.

munichand avatar munichand commented on September 18, 2024

Hi this is munichandra when i install the plugin it throwing error

from cordova-plugin-bluetooth-printer.

OliverTr54 avatar OliverTr54 commented on September 18, 2024

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.

Abhishek134 avatar Abhishek134 commented on September 18, 2024

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.

0xCoDeFi avatar 0xCoDeFi commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.