[英]Cordova and Windows Phone, calling cordova.exec
我需要一些幫助,以嘗試使用Phonegap使用cordova.exec執行插件。
我在這里遵循了該教程: WP插件教程
但是,當我嘗試運行此命令時,出現以下錯誤:
Error::Plugin not allowed in config.xml. Echo
這是我從javascript調用的方式:
cordova.exec(function(){ console.log("success");}, function(){console.log("fail");}, "Echo", "echo", ["input string"]);
這是我的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."));
}
}
}
只需添加到config.xml
<feature name="Echo">
<param name="wp-package" value="Echo" />
</feature>
插件名稱=“ Echo”已棄用,不再起作用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.