januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
368 stars 424 forks source link

print data from API / JSON #58

Closed rafiafmar closed 4 years ago

rafiafmar commented 5 years ago

how to print data from api / json? which calls array data using the fetch function

januslo commented 5 years ago

I am not sure what u r asking

发自我的 iPhone

在 2019年7月15日,下午8:39,rafiafmar notifications@github.com 写道:

how to print data from api / json? which calls array data using the fetch function

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rafiafmar commented 5 years ago

like in the example to print a recipe that the value is entered manually:

await BluetoothEscposPrinter.printText ("... \ r \ n", {});

or

await BluetoothEscposPrinter.printColumn (..., [...], [...], ["..."], {};

my question what if the value comes from an API / JSON array data, so the printed data can be automatic? I call the data array using the fetch function ... and i use android

januslo commented 5 years ago

Sorry, still cannot get it, but we can see a JSON as a js object, or you may need to parse it with with js JSON object.

发自我的 iPhone

在 2019年7月15日,下午9:38,rafiafmar notifications@github.com 写道:

like in the example to print a recipe that the value is entered manually:

await BluetoothEscposPrinter.printText ("... \ r \ n", {});

or

await BluetoothEscposPrinter.printColumn (..., [...], [...], ["..."], {};

my question what if the value comes from an API / JSON array data, so the printed data can be automatic? I call the data array using the fetch function ... and i use android

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

rafiafmar commented 5 years ago

sorry, what does it mean to see JSON as a js object? I have an API / JSON address: https://skripsiuwp.000webhostapp.com/SFA/Get_Produk.php

can it be printed or at least it can be displayed on the application screen according to the template of the recipe that you are example?

januslo commented 5 years ago

sorry are u a programmer? If not, plz ask your programmer to do that

发自我的 iPhone

在 2019年7月16日,上午6:43,rafiafmar notifications@github.com 写道:

sorry, what does it mean to see JSON as a js object? I have an API / JSON address: https://skripsiuwp.000webhostapp.com/SFA/keranjang_penjualan.php

can it be printed or at least it can be displayed on the application screen according to the template of the recipe that you are example?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

januslo commented 5 years ago

Hmmmm, This is a printing plugin, cannot handle the networks.

发自我的 iPhone

在 2019年7月16日,上午6:43,rafiafmar notifications@github.com 写道:

sorry, what does it mean to see JSON as a js object? I have an API / JSON address: https://skripsiuwp.000webhostapp.com/SFA/keranjang_penjualan.php

can it be printed or at least it can be displayed on the application screen according to the template of the recipe that you are example?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

rafiafmar commented 5 years ago

thank you for your information