Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show the printers name in a list ionic? #51

Open
ademir10 opened this issue Jun 21, 2021 · 1 comment
Open

How to show the printers name in a list ionic? #51

ademir10 opened this issue Jun 21, 2021 · 1 comment

Comments

@ademir10
Copy link

Hi guys!
I'm trying to show the printers available in a list but i don't know how to extract data from the function:
BTPrinter.list(function(data){
console.log("Success");
console.log(data); // paired bluetooth devices array
},function(err){
console.log("Error");
console.log(err);
});

How can i do it? i can see the printer info but i can't get data to show in a list, could you help me please?
i tried to inject the value data in a storage using async method but no way..

Captura de Tela 2021-06-21 às 18 12 43

@andreszs
Copy link
Contributor

The printer's info returns in your shown array. This array contains 3 indexes per paired BT device. The printer's internal name will be in data[0] and its BT address in data[1], as shown in your console screenshot, as long as your first paired BT device is the actual printer.

Notice that this list returns all paired BT devices, not just printers. Check the demo app on how to show a list of paired BT devices found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants