2014-02-19 45 views
0

背景:我将Windows Phone 8版本Katzer's LocalNotifications Plugin添加到asiFarran's LocalNotifications Plugin。我在plugins/wp8.json改变config_munge后从“0”到:1我没有得到Plugin not allowed in config.xml了和日志显示Adding feature.value=LocalNotification但现在:Phonegap 3.3.0:无法找到命令:: LocalNotification

问题:日志显示Unable to locate 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> 

器和插件在​​3210补充说:

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

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

如果我set the namespace in call方法我回到:Plugin not allowed in 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) 
     { 
... 

按照documentation类名称必须与我在exec()我打电话匹配。所以我的错误一定是我想的其他地方。

更新

我找不到在WP8项目LocalNotification.cs。这个插件文件应该如何以及在哪里添加?

回答

0

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