cordova local notification plugin
cordova plugin add org.apache.cordova.device
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git && cordova prepare
1.
需要上面的两个插件 安装插件
在deviceready 设备准备好了调用插件的方法:
notification.local.add
notification.local.cancel
notification.local.cancelAll
notification.local.isScheduled
notification.local.getScheduledIds
notification.local.isTriggered
notification.local.getDefaults
notification.local.setDefaults
notification.local.onadd
notification.local.ontrigger
notification.local.onclick
notification.local.oncancel
2.具体如下:
document.addEventListener('deviceready', function () {
// window.plugin.notification.local is now available
var now = new Date().getTime();
_60_seconds_from_now = new Date(now + 60 * 1000);
window.plugin.notification.local.add({
id: 1,
title: 'Reminder',
message: 'Dont forget to buy some flowers.',
badge: 1,
autoCancel: true,
date: _60_seconds_from_now
});
window.plugin.notification.local.onclick = function(id, state, json) {
window.plugin.notification.local.cancelAll();
};
}, false);
cordova local notification plugin的更多相关文章
- [转]com.devicepush.cordova-phonegap Device Push Notification Plugin
本文转自:https://www.npmjs.com/package/com.devicepush.cordova-phonegap Device Push Notification Plugin D ...
- Jenkis Editable Email Notification Plugin 使用介绍
Jenkis Editable Email Notification Plugin 使用介绍 前言 Jenkins本身提供的Email插件功能实在有限,只能提供当前Job的基本信息,比如成功.失败以及 ...
- ios push local notification
UILocalNotification* localNotification = [[UILocalNotification alloc]init]; localNotification.alertB ...
- Local Notification
大家都知道Push Notification,这个东西需要联网才可以用.iOS4起,苹果引入了一种可以在设备内部引发的notification.不需要复杂的服务器编程,或其他复杂的配置.这个技术就是L ...
- iOS 远程通知(Remote Notification)和本地通知(Local Notification)
ios通知分为远程通知和本地通知,远程通知需要连接网络,本地通知是不需要的,不管用户是打开应用还是关闭应用,我们的通知都会发出,并被客户端收到 我们使用远程通知主要是随时更新最新的数据给用户,使用本地 ...
- Cordova 3.0 Plugin 安装 及"git" command line tool is not installed
根据http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface Windows命令行 ...
- 对cordova插件配置文件plugin.xml的理解
1.配置文件表头包括了插件id,是用于唯一标识插件的.同时插件配置了一个插件名称. 2.这个文件从工作机制,也就是js代码一直到native的java插件代码工作分成两个流程.第一个流程是从代码到插件 ...
- iOS 10.0之前和之后的Local Notification有神马不同
在iOS 10.0之前apple还没有将通知功能单独拿出来自成一系.而从10.0开始原来的本地通知仍然可用,只是被标记为过时.于是乎我们可以使用10.0全新的通知功能.别急-让我们慢慢来,先从iOS ...
- Jenkins-Dingding Notification Plugin 配置
具体内容请移步Jenkins官网或作者Github,本文仅为实践分享,记录几个小坑! 感谢插件作者的贡献! 转载注明出处:http://www.cnblogs.com/ityoung/p/648915 ...
随机推荐
- iphone dev 入门实例1:Use Storyboards to Build Table View
http://www.appcoda.com/use-storyboards-to-build-navigation-controller-and-table-view/ Creating Navig ...
- mysqli 操作数据库
从php5.0开始增加mysql(i)支持 , 新加的功能都以对象的形式添加 i表示改进的意思 功能多.效率高.稳定 编译时参数: ./configure --with-mysql=/usr/bin/ ...
- JAVA 网格布局管理器
//网格布局管理器 import java.awt.*; import javax.swing.*; public class Jiemian3 extends JFrame{ //定义组件 JBut ...
- 安装java开发环境jdk,安装JDK
JDK可以理解为翻译官,它将Java高级语言翻译为二进制执行. JDK可以编译文件,编译后的文件扩展名为.class. 只要能支持JDK的地方,JAVA就可以运行,这就是JAVA跨平台的性质. 我的是 ...
- JS正则实例
<html> <body> </body> </html> <script> var strSrc = "xxa1b01c001y ...
- [AIR] 利用SnapShot.exe实现QQ截屏功能
主类(可作文档类): package { import flash.display.Bitmap; import flash.display.Sprite; import flash.events.E ...
- [Java] 将标准字符流写入到文件中(通过控制台写一个html程序,并保存)
package test.stream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.Fi ...
- 反人类的MyEclipse之-MyEclipse代码自动补全
如果你用过Visual Studio的自动补全功能后,再来用eclipse的自动补全功能,相信大家会有些许失望. 但是eclipse其实是非常强大的,eclipse的自动补全没有VS那么好是因为ecl ...
- jsp标准标签库
抄袭自:http://www.cnblogs.com/hongten/archive/2011/05/14/2046005.html JSP标准标签库 Pass by xkk ,and aut ...
- poj 1753 Flip Game
点击打开链接 Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25674 Accepted: 1109 ...