Phonegap 3.3.0:无法找到command :: LocalNotification [英] Phonegap 3.3.0: Unable to locate command :: LocalNotification

查看:312
本文介绍了Phonegap 3.3.0:无法找到command :: LocalNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我添加了 Katzer's的Windows Phone 8版本LocalNotifications Plugin 导入 asiFarran的LocalNotifications插件。在我将 plugins / wp8.json 中的 config_munge 从:0更改为:1 我不再获得插件不允许在config.xml 任何更多和日志显示添加feature.value = LocalNotification 但现在:

Background: I add the Windows Phone 8 Version of Katzer's LocalNotifications Plugin into asiFarran's LocalNotifications Plugin. After I changed config_munge in plugins/wp8.json from ' :0' to :1 I am not getting Plugin not allowed in config.xml anymore and log shows Adding feature.value=LocalNotification but now:

问题:日志显示无法找到command :: LocalNotification

我已将此追踪到 CommandFactory.cs line 94

我的 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>

并且插件添加到 config.xml

<gap:plugin name="com.stratogos.cordova.localNotifications" version="0.1.0" />

文件复制到 platform / wp8 。我删除并重新创建了wp8平台,但没有解决它。

Files get copied into platform/wp8. I removed and recreated the wp8 platform but that did not fix it.

如果我 config.xml中不允许插件 c>。

If I set the namespace in call method I am back to: Plugin not allowed in config.xml.

在JavaScript中我正在呼叫

In JavaScript I am calling

exec(null,null,"LocalNotification","addNotification",[defaults]);

插件有 src / wp8 / LocalNotification.cs 与:

namespace Cordova.Extension.Commands
{
    public class LocalNotification : BaseCommand
    {
        public void addNotification(string jsonArgs)
        {
...

根据文档 a>类名称必须与我在 exec()中调用的名称匹配。所以我的错误必须在别的地方。

According to the documentation the Class name must match with what I am calling in exec(). So my mistake must be somewhere else I think.

更新

找不到wp8项目中的 LocalNotification.cs

I could not find the LocalNotification.cs in the wp8 project. How and where is this plugin file supposed to be added?

推荐答案

我解决了这个问题,手动添加wp8源文件从 plugins / YOURPLUGIN / src / wp8 / * 进入项目。如果在Visual Studio中打开它,您可以将文件拖放到文件夹中。我把它拖到 / cordovalib ,但一个额外的文件夹插件会更好。

I solved this issue by manually adding the wp8 source files from plugins/YOURPLUGIN/src/wp8/* into the project. If you open it in Visual Studio you can drag and drop the file into a folder. I dragged it into /cordovalib but an extra folder for plugins would be nicer.

这篇关于Phonegap 3.3.0:无法找到command :: LocalNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆