Comments (11)
from react-native-bluetooth-escpos-printer.
okay, just the way you are checking Bluetooth status, can you also check connected status, whether a pos device is connected to Bluetooth or not. I am having command not found warning lot of times.
and regarding this issue, You should have some callback, which can be executed from the app once user turns Bluetooth on
from react-native-bluetooth-escpos-printer.
@januslo If I am running scanDevices function, more than one time, it falls in catch block, How did you handled connectivity issues can you please provide me some example
from react-native-bluetooth-escpos-printer.
from react-native-bluetooth-escpos-printer.
@januslo can you please let me know how to connect to printer using this package. I am facing problems. Sometimes it doesn't show my device in paired devices array even if the device is paired. then I need to restart the app and turn bluetooth on/off it sharts showing
from react-native-bluetooth-escpos-printer.
marry Eve, plz try more about the bluetoothManager, the relates operations should be included in it.
You may try to listen the event rather then using the method returns, I am sorry I need to do more testing about the method returns later.
DeviceEventEmitter.addListener(
BluetoothManager.EVENT_DEVICE_ALREADY_PAIRED, (rsp)=> {
this._deviceAlreadPaired(rsp) // rsp.devices would returns the paired devices array in JSON string.
});
DeviceEventEmitter.addListener(
BluetoothManager.EVENT_DEVICE_FOUND, (rsp)=> {
this._deviceFoundEvent(rsp) // rsp.devices would returns the found device object in JSON string
});
from react-native-bluetooth-escpos-printer.
okay, thanks. This thing can be solved now. Can I connect to device more than once. I mean if a device is connected can I connect to it again.
or to avoid this, how can I know which device is connected to the printer at the current moment.
sometimes I am getting this error Error: Unable connect device, when I try to reconnect to the paired device
from react-native-bluetooth-escpos-printer.
Actually, we suffer the same thing, In the last commit, I update the android connect mechanism that would check the current connect and return the connected device name directly. In one word, plz update the repo to the last one (with git url directly current, will publish a new version after this mechanism is applied and tested in IOS as well) and you can just call connect() once again.
from react-native-bluetooth-escpos-printer.
I tried adding these methods also, but getting these functions as undefined :(
can you fix this: here is the code
`
@ReactMethod
public void isDeviceConnected(Callback booleanCallback) {
Boolean isConnected = true;
if (mService != null) {
switch (mService.getState()) {
case 0:
isConnected = false;
break;
case 2:
isConnected = false;
break;
case 3:
isConnected = true;
break;
default:
isConnected = false;
break;
}
}
booleanCallback.invoke(isConnected);
}
/* Return the address of the currently connected device */
@ReactMethod
public void getConnectedDeviceAddress(final Promise promise) {
if (mService!=null){
promise.resolve(mService.getLastConnectedDeviceAddress());
}
}`
from react-native-bluetooth-escpos-printer.
plz make sure your code was installed into node_module folder.
from react-native-bluetooth-escpos-printer.
Now, I finally I am able to connect to pos printer flawlessly, Thanks for your help. Will give you a pull request soon, I have added both of these methods, which makes the connection with pos easier.
from react-native-bluetooth-escpos-printer.
Related Issues (20)
- In this print package i am trying to print the indian Rupee symbol (₹) with amount but it is not printing it is printing other symbol (?) HOT 1
- 'imageRef passed is not a CGImageRef' was thrown while invoking printQRCode
- Can not Connect in iOS HOT 2
- App crash when connnecting Bluetooth on android 14 HOT 5
- Scan Error HOT 2
- hasil dari print TSC menampilkan seluruh fungsi dari options, bagaimana cara mengatasinya HOT 1
- korean language?
- Remove white space after print image ?
- Best printer package, but we need an update!!!! HOT 2
- Application crashes on android versions greater than 10. HOT 3
- I cannot print accented Vietnamese
- Measurement are not correct?
- How to upload react-native-bluetooth-escpos-printer without node module HOT 1
- How to print using Serial Port (Com Port) ?
- Does anyone continue to maintain this library? HOT 2
- Bluetooth printing error: Printer feeds paper but doesn't complete printing
- how i can set print multi language??
- Hello @vgvishal538 Have You Found Any Encoding That Print Indian Languages ? Please Tell Me. HOT 1
- Mobile Preview before Print HOT 1
- How to use this in the latest expo framework HOT 2
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 react-native-bluetooth-escpos-printer.