react-native-esc-pos-printer icon indicating copy to clipboard operation
react-native-esc-pos-printer copied to clipboard

Incorrect return type of printing.send() when using multiple printers

Open ipa127001 opened this issue 2 years ago • 3 comments

I am developing an Android app using the library with version 2.3.0, the return types are different when I run the following code. Is it normal?

Source 1:

printing.initialize().text("hello, is it me you're looking for").send();

return type:

`interface IMonitorStatus {

connection: string; online: string; coverOpen: string; paper: string; paperFeed: string; panelSwitch: string; drawer: string; errorStatus: string; autoRecoverErr: string; adapter: string; batteryLevel: string; }: `

Source 2 (Multiple printers):

printing.initialize().text("hello, is it me you're looking for").send({target});

Return type:

result: string;

e.g. 'PRINT_SUCCESS'

ipa127001 avatar Feb 15 '23 07:02 ipa127001

@ipa127001 if you are using instantiate method then i think it would return you success message . But if you use init method to initialize the printer then it returns an object containing properties like connection, online etc

Rehankhalil462 avatar Feb 16 '23 08:02 Rehankhalil462

@ipa127001 if you are using instantiate method then i think it would return you success message . But if you use init method to initialize the printer then it returns an object containing properties like connection, online etc

I think you have told me the "fact" after called the 2 methods. However, I want to know why the 2 results are different. The document does not mention for this change and the status actually helps us to know the print is success or not.

ipa127001 avatar Feb 17 '23 10:02 ipa127001

@ipa127001 got it. I've already opened an issue to get to know about the error/result messages description which is not mentioned in the library documentation.
Let me know if you get something.

Rehankhalil462 avatar Feb 18 '23 19:02 Rehankhalil462

Resolved in 4.0.0

tr3v3r avatar Jul 25 '24 09:07 tr3v3r