我正在尝试使 LocalNotification 插件正常工作(适用于 ios 或 android),但无法找到正确的文档。有谁知道我做错了什么或我需要添加什么?我正在尝试以下操作:
从命令行使用以下内容添加了插件
phonegap local plugin add https://github.com/katzer/cordova-plugin-local-notifications.git
在 config.xml 中尝试了以下两项:
<plugin name="LocalNotification" value="LocalNotification" />
和
<feature name="LocalNotification">
<param name="ios-package" value="LocalNotification"/>
</feature>
将 local-notification.js 添加到 www 文件夹并将其包含在 index.html 文件中,内容如下:
<script src="local-notification.js"></script>
并具有以下使用控制器中的插件(我正在使用 Angular):
$scope.localNotify = function(){
var d = new Date();
d = d.getTime() + 5*1000; //60 seconds from now
d = new Date(d);
window.plugins.localNotification.add({
date: d,
repeat:'daily',
message: 'This just fired after a minute!',
hasAction: true,
badge: 1,
id: '1',
sound:'horn.caf',
background:'app.background',
foreground:'app.running'
});
};
我在自述文件中看到https://github.com/simplec-dev/LocalNotification/blob/45867c94ee96aaa90966d22b62acabfc03807cb3/README.md他们说要修改 CDVPlugin.m 和 CDVPlugin.h,但我在我的任何地方都看不到这些文件项目。
任何帮助将不胜感激,谢谢!