Javascript Phonegap 3.3.0:无法定位命令::LocalNotification
背景:我将Windows Phone 8版本添加到。在我将Javascript Phonegap 3.3.0:无法定位命令::LocalNotification,javascript,plugins,cordova,windows-phone-8,Javascript,Plugins,Cordova,Windows Phone 8,背景:我将Windows Phone 8版本添加到。在我将plugins/wp8.json中的config\u munge从“:0”更改为:1之后,我不再获得config.xml中不允许的插件,日志显示添加功能。value=LocalNotification,但现在: 问题:日志显示无法定位命令::LocalNotification 我查到了 我的plugin.xml包含wp8的以下内容: <platform name="wp8"> <config-file targe
plugins/wp8.json
中的config\u munge
从“:0”更改为:1
之后,我不再获得config.xml中不允许的插件,日志显示添加功能。value=LocalNotification
,但现在:
问题:日志显示无法定位命令::LocalNotification
我查到了
我的plugin.xml
包含wp8的以下内容:
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="wp-package" value="LocalNotification"/>
</feature>
</config-file>
<source-file src="src/wp8/LocalNotification.cs" />
<source-file src="src/wp8/Options.cs" />
</platform>
文件被复制到平台/wp8
。我删除并重新创建了wp8平台,但这并没有修复它
如果我重新选择了方法:config.xml中不允许使用插件
我用JavaScript打电话
exec(null,null,"LocalNotification","addNotification",[defaults]);
该插件具有src/wp8/LocalNotification.cs
和:
namespace Cordova.Extension.Commands
{
public class LocalNotification : BaseCommand
{
public void addNotification(string jsonArgs)
{
...
根据定义,类名必须与我在exec()
中调用的内容匹配。所以我想我的错误一定是在别的地方
更新
我在wp8项目中找不到LocalNotification.cs
。这个插件文件应该如何添加以及在哪里添加?我通过手动将plugins/YOURPLUGIN/src/wp8/*
中的wp8源文件添加到项目中,解决了这个问题。如果在Visual Studio中打开该文件,则可以将其拖放到文件夹中。我把它拖到了/cordovalib
中,但是一个额外的插件文件夹会更好
namespace Cordova.Extension.Commands
{
public class LocalNotification : BaseCommand
{
public void addNotification(string jsonArgs)
{
...