Plugin not found error when building a simple plugin

Hello Team 


I am trying to build a simple outsystems plugin from a cordova plugin hello. 

I cloned the Template_plugin and tried to implement the Check method with the code 


$parameters.IsAvailable = false;

if (typeof(window.plugins) !== 'undefined') {

  $parameters.IsAvailable = typeof(window.plugins.hello) !== 'undefined';

}


But I am getting the error message "Plugin is not loaded". 


Can anyone help. 


Solution

Hello Swapnil, 

Check for the target property of plugin.xml of your cordova plugin. Use this in the typeof().  

<js-module src="www/hello.js" name="hello">
    <clobbers target="hello" />
  </js-module>

In your Check_XXX method, use the below snippet. 


$parameters.IsAvailable = typeof("hello") !== 'undefined';

You can verify this, by looking at some existing plugins, their respective plugin.xml and Check_XXX methods.

This should help !!!

Solution

Thank you! Its working now