【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 ...
随机推荐
- mac的idea不能编辑问题
在安装的时候,因为在选择插件的时候,把IDEAVim这个玩意儿选上了.所以,编辑模式就跟命令行里面的Vim一样.输入时,需要先输入i, 进入insert模式下,然后才可以编辑.彻底解决办法就是进入Pr ...
- Python3 中hashlib及uuid的用法
Python3 中hashlib及uuid的用法: 可以生成随机ID import uuid import hashlib import time def creat_uuid(): return s ...
- iOS开发之蓝牙使用-建立连接的
1.大佬笔记 CSDN 2.代码 github
- 算法训练 数字三角形(DP)
问题描述 (图3.1-1)示出了一个数字三角形. 请编一个程序计算从顶至底的某处的一条路 径,使该路径所经过的数字的总和最大. ●每一步可沿左斜线向下或右斜线向下走: ●1<三角形行数≤100: ...
- STL_ALGORITHM_H
sort_unique_copy /////////////////////////////////////////////////////////// // Copyright (c) 2013, ...
- POI2011 Tree Rotations
POI2011 Tree Rotations 给定一个n<=2e5个叶子的二叉树,可以交换每个点的左右子树.要求前序遍历叶子的逆序对最少. 由于对于当前结点x,交换左右子树,对于范围之外的逆序对 ...
- From表单提交刷新页面?
form表单提交跳转 写作原因: 楼主的html水平一般,偶然想起周围人常说的form表单提交会刷新页面,闲来无事,就想想其中的原因 想来想去为什么会刷新,猜想了以下几条 1.先提交数据,等服务器 ...
- Centos7安装MySQL8.0
请到这个地址看:https://www.cnblogs.com/kevingrace/p/10482469.html Centos7安装MySQL8.0 - 操作手册 一.yum安装方式: 卸载之前版 ...
- springboot整合redis存放session
y进入maven依赖: <!--spring boot 与redis应用基本环境配置 --> <dependency> <groupId>org.springfra ...
- (转)Selenium-11: Execute JavaScript with JavascriptExecutor
Outline Sometimes we cannot handle some conditions or problems with Webdriver, web controls don’t re ...