【Ionic】---Using Local Notifications In Your Ionic Framework App
Using Local Notifications In Your Ionic Framework App
配置好ng-cordova先
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
var ionicApp = angular.module("ionic", ["ionic", "ngCordova"]);
然后
cordova plugin add de.appplant.cordova.plugin.local-notification
ionicApp.controller("ExampleController", function($scope, $cordovaLocalNotification) {
$scope.add = function() {
var alarmTime = new Date();
alarmTime.setMinutes(alarmTime.getMinutes() + 1);
$cordovaLocalNotification.add({
id: "1234",
date: alarmTime,
message: "This is a message",
title: "This is a title",
autoCancel: true,
sound: null
}).then(function () {
console.log("The notification has been set");
});
};
$scope.isScheduled = function() {
$cordovaLocalNotification.isScheduled("1234").then(function(isScheduled) {
alert("Notification 1234 Scheduled: " + isScheduled);
});
}
});
【Ionic】---Using Local Notifications In Your Ionic Framework App的更多相关文章
- 【Android】2.0 第2章 初识Android App
分类:C#.Android.VS2015: 创建日期:2016-02-04 一.认识Android操作系统 Android最早由安迪•罗宾(Andy Rubin)创办,2007年被Google公司收 ...
- 【转载】关于 Google Chrome 中的全屏模式和 APP 模式
[来源于]新浪微博:@阿博 http://www.cnblogs.com/abel/p/3235839.html 全屏模式:kiosk 默认全屏打开一个网页呢,只需要在快捷方式中加上 --kiosk ...
- 【原】Storm Local模式和生产环境中Topology运行配置
Storm入门教程 1. Storm基础 Storm Storm主要特点 Storm基本概念 Storm调度器 Storm配置 Guaranteeing Message Processing(消息处理 ...
- 【java】A local class access to local variables
内部类参考 A local class has access to local variables. However, a local class can only access local vari ...
- 【mysql】 load local data infield 报错 ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> load data local infile '/Users/flint/learn/mysql/pet' into table bx_pet; 执行报错 ERROR 1148 ( ...
- 【Mac】 /usr/local 文件夹权限问题
修改文件夹权限 sudo chown -R $(whoami) /usr/local/ 如果失败提示Operation not permitted 或其他权限不足,则需要关闭Rootless Root ...
- 【转】Thread Local的正确原理与适用场景
本文转发自技术世界,原文链接 http://www.jasongj.com/java/threadlocal/ ThreadLocal解决什么问题 由于 ThreadLocal 支持范型,如 Thre ...
- 【iOS】Updating local specs repositories
使用 Pods 时遇到这个问题,原因是被墙了……需换成下面命令: pod install --verbose --no-repo-update
- 【原创】小白学jquery Mobile《构建跨平台APP:jQuery Mobile移动应用实战》连载五(给按钮加图标)
在范例5-4所使用的导航栏中,已经为按钮加入了图标的样式,但是当时并没有介绍按钮的图标究竟是怎么一回事.下面截取范例5-4中导航栏部分的代码: <divdata-role="foote ...
随机推荐
- Repeater控件最后一笔记录高亮显示
Insus.NET以前有写过 <Repeater控件第前10笔记录高亮显示> 不过,现在有一个想法,就是最后一笔记录高亮显示,怎样实现? 技术要求,就是获取最后一笔的索引即可.可以从数据源 ...
- Android Android环境安装
Android环境安装 一.下载: 所需:eclipse.sdk.jdk.adt 参考 工具下载地址:http://www.androiddevtools.cn/ 二安装: 1.eclipse: 选择 ...
- CHImage
1.启动图.图标 iOS应用图片尺寸制作脚本 ======= github 规格尺寸(官方) AppIcon应用图标 and Launchimage启动图标的制作 iPhone所有手机型号屏幕尺寸 2 ...
- 659. Split Array into Consecutive Subsequences
You are given an integer array sorted in ascending order (may contain duplicates), you need to split ...
- Automake基本用法
一. 确认你的系统安装有GNU的如下软件: 1. automake2. autoconf3. m44. perl5. 如果你需要产生共享库(shared library)则还需要GNU Libtool ...
- hyperledger fabric 中java chaincode 支持离线打包
联盟链由于其本身的特性,目前应用在一些大型国有企业银行比较多.出于安全考虑,这些企业一般会隔离外网环境.所以在实际生产需求中可能存在需要在一个离线的环境中打包安装chaincode的情况. 本文基于这 ...
- ceph数据自动均衡程序
声明:程序基于ceph0.94.x制作 前言: ceph数据自动均衡,为了解决新集群搭建完成和添加新的节点后,不同或者相同容量的磁盘上面pg的分布不均衡,导致集群使用率达不到理想的标准 调整前准备: ...
- 2、OpenCV Python 图像属性获取
__author__ = "WSX" import cv2 as cv import numpy as np image = cv.imread("1.JPG" ...
- (Python OpenGL)【3】着色器 PyOpenGL
(Python OpenGL)现在开始我们使用着色器来进行渲染.着色器是目前做3D图形最流行的方式. OpenGL的渲染管线流程: 数据传输到OpenGL—>顶点处理器—>细分着色—> ...
- 状压DP【洛谷P1896】 [SCOI2005]互不侵犯
P1896 [SCOI2005]互不侵犯 题目描述 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案.国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子 ...