AbobosSoftware / cordova-plugin-brother-label-printer

Cordova and Capacitor plugin for Bother Label Printers
MIT License
10 stars 16 forks source link

Printing failed #20

Closed firdaus48 closed 1 year ago

firdaus48 commented 4 years ago

hi I am getting following error after calling printViaSDK.

Error: "Unexpected Internal System Error: IllegalArgumentException"

using printer brother QL-1110NWB

this is my code let image = "isbase64Image"; //sample actually use base64 cordova.plugins.brotherPrinter.printViaSDK(image, function (printResult) { //var printResult = callback; console.log(printResult); },function (err){ console.log(err); }); Thank you. please help

arcadius commented 4 years ago

QL-1110NWB seems not supported at the moment Are you able to look at the code and fix this?

firdaus48 commented 4 years ago

i have tried to fix this issue, but no idea, do you have any solusion?

firdaus48 commented 4 years ago

what if i use the other model like epson ? can i use this plugin ?

robr2112 commented 4 years ago

Support for QL-1110NWB was added to the SDK in v3.1.5, per the SDK release notes here: https://support.brother.com/g/s/es/htmldoc/mobilesdk/about/release-notes-ios.html

The SDK framework currently included with this plugin is v3.1.1, per the info.plist file inside the framework:

CFBundleShortVersionString 3.1.1

So, you need to update the SDK if you require support for the QL-1110NWB printer.

You may download the latest SDK here: https://www.brother.co.jp/eng/dev/mobilesdk/download/index.aspx

NOTE: Beginning with SDK 3.1.10 and later, the framework is now a Dynamic library, which requires it to be "embedded" in the application.

And, no, you will not be able to use this plugin with any non-Brother printer model, at least when using the image printing method.

firdaus48 commented 4 years ago

hi @robr2112 thank u for your response,

how to update the new SDK to this plugin ?

robr2112 commented 4 years ago

Replace the BRPtouchPrinterKit.framework in src/ios/lib folder with the latest download version.

The SDK APIs are mostly the same so it shouldn’t require much (if any) modification to the rest of the plugin, though I’m not certain of that(as I’m not expert with this plugin). The new SDK should recognize the QL-1110NWB printer model name.

The biggest challenge may be to change the plugin project settings to “embed” the framework (as I mentioned last time). I’m not sure how to do that in Cordova, ie outside of Xcode. But this should be a simple change.

Hopefully this gets you moving forward. I support the SDK but I’m not expert with this plugin.

firdaus48 commented 4 years ago

hi @robr2112

thank u very much for your suggest . finally its works

arcadius commented 4 years ago

@robr2112 , would it be possible you submit a pull request for the framework upgrade? Thanks

robr2112 commented 4 years ago

@arcadius , I'm not sure why you would need me to do a pull request? Can't you just download the latest SDK and integrate it? (of course, beware the new dynamic framework requires embedding, as mentioned already in this thread).

The SDKs (both iOS and Android) update somewhat regularly, so IMO it's a good idea to check these updates once in a while.

arcadius commented 1 year ago

Issuue was confirmed resolved in https://github.com/AboboSoftware/cordova-plugin-brother-label-printer/issues/20#issuecomment-580662171