HI,I am getting error at below action where plugin is checking -
typeof(window.plugins.intentShim) !== 'undefined'Any input will be appreciated.
To resolve the issue with the error checking typeof(window.plugins.intentShim) !== 'undefined' in an OutSystems action, you should follow these steps:
typeof(window.plugins.intentShim) !== 'undefined'
Verify Plugin Installation: Ensure that the intentShim plugin is correctly installed in your application. To do this:
intentShim
Validate Cordova Environment: The error could also occur if the app is running outside a Cordova environment, such as in a web browser. The flow shown in your image includes a check for IsCordovaDefined. Ensure that you correctly verify if the cordova object exists before proceeding further. For instance, in JavaScript, you can check:
IsCordovaDefined
cordova
if (window.cordova) { // Cordova is available, proceed with plugin checks }
Add Plugin Availability Checks: Since your action flow already has a check for IsCordovaDefined, make sure it is correctly implemented. If IsCordovaDefined.IsLoaded? or PluginIsLoaded.IsAvailable? evaluates to false, ensure that the failure path sets appropriate outputs or logs an error. This step is essential when relying on plugins that might not be properly loaded. Refer to File Viewer Plugin not working with OutSystems 11 for similar troubleshooting steps.
IsCordovaDefined.IsLoaded?
PluginIsLoaded.IsAvailable?
Check for JavaScript Execution Timing: JavaScript that accesses window.plugins.intentShim must be executed only after the deviceready event. Ensure that your code is wrapped in a listener for deviceready, like so:
window.plugins.intentShim
deviceready
document.addEventListener("deviceready", function() { if (typeof window.plugins.intentShim !== 'undefined') { // Plugin is available, proceed } else { // Plugin is not available, handle the error } }, false);
Re-generate the App Package: If the plugin is working locally but not in your generated app on the device, try regenerating your app package after verifying the above steps. Uninstall the app from the device, reinstall the newly generated app, and test again. Similar steps were used to resolve a plugin issue here: File Viewer Plugin not working with OutSystems 11.
By following these checks and steps, you should be able to identify why the plugin is not detected and successfully resolve the issue. If the problem persists after completing these steps, consider reaching out to OutSystems support for additional guidance.
Hi,
I think this error occurs because window.plugins is undefined, which means the required Cordova plugin (intentShim) is not available or not loaded properly. So, you can refer this document. This may help your issue. if issue still persists you can support ticket for the above issue.
Thanks,
Sriyamini J
This error usually occurs when: