2017-09-26 14 views
0

已安装cordova-plugin-local-notifications并重试它。 的代码行的错误occures -在手机上运行Ember Cordova应用程序,出现错误 - 无法读取未定义的属性'通知'

cordova.plugins.notification.local.on("click", function (notification) { 

错误: -

Error while processing route: dashboard Cannot read property 'notification' of undefined TypeError: Cannot read property 'notification' of undefined

在评论这条线,我得到了另一个错误为眼前的下一行

states[Connection.UNKNOWN] = 'Unknown connection'; 

再次给说连接不存在的错误。我认为有一些cordova软件包或依赖项丢失。但是在另一个应用程序的application.js上运行这些相同的代码行,并没有给出这样的错误。在比较工作的应用程序和没有工作的应用程序时,没有发现与包和jower json文件丢失的cordova没有关系。

Also in this case, cordova didn't have the function plugin. But the other app that had the same packages and lines of code in application.js, had plugin in cordova object.

回答

0

插件在科尔多瓦/ config.xml中

<widget id="com.company.app" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 
... 
<plugin name="de.appplant.cordova.plugin.local-notification" spec="https://github.com/katzer/cordova-plugin-local-notifications" /> 
... 
</widget 

失踪这解决了在重建的问题。

相关问题