NeutrinosPlatform / cordova-plugin-document-scanner

cordova plugin for document scan
https://www.neutrinos.co/
MIT License
84 stars 63 forks source link

Problem with Foto handover, "TypeError" in Callback #53

Closed bendspoons closed 5 years ago

bendspoons commented 5 years ago

SInce a feew days, i can not use the Plugin anymore. I didnt change ANY Code line, so i think it is not my fault... When making a Scan with this pluzgin, and click "Save", i do not get the image - i get this error:

2019-05-10 11:44:52.993 17264-17264/com.app.example D/CordovaActivity: Incoming Result. Request code = 99 2019-05-10 11:44:52.993 17264-17264/com.app.example D/CordovaInterfaceImpl: Sending activity result to plugin 2019-05-10 11:44:53.015 17264-17264/com.app.example D/CordovaActivity: Started the activity. 2019-05-10 11:44:53.015 17264-17264/com.app.example D/CordovaActivity: Resumed the activity. 2019-05-10 11:44:53.040 17264-17264/com.app.example D/SystemWebChromeClient: file:///android_asset/www/cordova.js: Line 309 : Error in Success callbackId: Scan63209691 : TypeError: callback.success.apply is not a function 2019-05-10 11:44:53.040 17264-17264/com.app.example I/chromium: [INFO:CONSOLE(309)] "Error in Success callbackId: Scan63209691 : TypeError: callback.success.apply is not a function", source: file:///android_asset/www/cordova.js (309) 2019-05-10 11:44:53.041 17264-17264/com.app.example D/SystemWebChromeClient: file:///android_asset/www/cordova.js: Line 310 : TypeError: callback.success.apply is not a function at Object.callbackFromNative (file:///android_asset/www/cordova.js:291:58) at :1:9 2019-05-10 11:44:53.041 17264-17264/com.app.example I/chromium: [INFO:CONSOLE(310)] "TypeError: callback.success.apply is not a function at Object.callbackFromNative (file:///android_asset/www/cordova.js:291:58) at :1:9", source: file:///android_asset/www/cordova.js (310) 2019-05-10 11:44:53.041 17264-17264/com.app.example D/SystemWebChromeClient: file:///android_asset/www/cordova.js: Line 312 : Uncaught TypeError: callback.success.apply is not a function

I have no idea what to do.

Using Cordova 8.1.2

bendspoons commented 5 years ago

Okay, "solved" it myself. This happens because of newly released 4.x Verison. You switched the order of callback functions.

Was: type, success, error Now: succes, error, options

ChrisTomAlx commented 5 years ago

Yea official cordova plugins follow the same format so I switched it. I am glad that you were able to figure this out :)

Cheers, Chris Neutrinos