Catch unhandled ScanditSDK calls and log them.
If a call to a function in a plugin does not exist, an error will be displayed. This disrupts the application flow. Therefore we implement the known calls and just log them as a warning to the console of the browser.
This closes #67
diff --git a/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js b/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
index 9d597fa..9f47cb1 100644
--- a/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
+++ b/lib/client/platform/cordova/3.0.0/bridge/scanditsdk.js
@@ -81,6 +81,14 @@
}
]
});
-
}
};
+
+['start', 'stop', 'cancel', 'pause', 'resume', 'resize', 'torch'].forEach(function(name) {
+ module.exports[name] = function() {
+ var messages = ['No emulation method found for ScanditSDK call [', name, '] called with:'];
+ messages.push(arguments);
+ console.warn.apply(console, messages);
+ };
+});
+