Reputation: 3226
I need some help trying to execute a plugin using the cordova.exec using Phonegap.
I followed the tutorial here: WP plugin tutorial
However When I try to run this I get the following error:
Error::Plugin not allowed in config.xml. Echo
Here is how I am calling it from javascript:
cordova.exec(function(){ console.log("success");}, function(){console.log("fail");}, "Echo", "echo", ["input string"]);
here is my Echo.cs
using WPCordovaClassLib.Cordova;
using WPCordovaClassLib.Cordova.Commands;
using WPCordovaClassLib.Cordova.JSON;
namespace Cordova.Extension.Commands
{
public class Echo : BaseCommand
{
public void echo(string options)
{
string optVal = JsonHelper.Deserialize<string[]>(options)[0];
DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "Everything went as planned, this is a result that is passed to the success handler."));
}
}
}
Upvotes: 0
Views: 682
Reputation: 23
just add to config.xml
<feature name="Echo">
<param name="wp-package" value="Echo" />
</feature>
the plugin name="Echo" is deprecated and doesn't work anymore
Upvotes: 1