本地通知Local Notifications

1.安装插件

ionic cordova plugin add cordova-plugin-local-notification
npm install @ionic-native/local-notifications

2.在app.components.ts中引用

import { Component } from '@angular/core';import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
s
@Component({selector: 'app-root',templateUrl: 'app.component.html',styleUrls: ['app.component.scss']
})
export class AppComponent {constructor(private platform: Platform,private splashScreen: SplashScreen,private statusBar: StatusBar,private localNotifications: LocalNotifications,) {this.initializeApp();}initializeApp() {this.testStatus();this.platform.ready().then(() => {this.statusBar.styleDefault();this.splashScreen.hide();});}testStatus() {this.localNotifications.schedule({id: 1,title: '通知标题',text: '这是显示通知栏的内容',// icon: '',trigger: { at: new Date(new Date().getTime() + 9000) },});}}

目前在android上测试不支持android9.0版本

ionic4本地通知Local Notifications相关推荐

  1. iOS 远程通知(Remote Notification)和本地通知(Local Notification)

    ios通知分为远程通知和本地通知,远程通知需要连接网络,本地通知是不需要的,不管用户是打开应用还是关闭应用,我们的通知都会发出,并被客户端收到 我们使用远程通知主要是随时更新最新的数据给用户,使用本地 ...

  2. iOS实现本地通知(local notification)的方法

    iOS 的本地通知(local notification)用于基于时间行为的通知,比如有关日历或者 todo 列表的小应用.另外应用如果在后台执行,iOS 允许它在受限的时间内运 行,它也会发现本地通 ...

  3. [原]逆向iOS SDK -- “添加本地通知”的流程分析

    观点: 代码面前没有秘密 添加通知的 Demo 代码 - (void)scheduleOneLocalNotification { [[UIApplication sharedApplication] ...

  4. 注册本地通知【闹钟,备忘录】

    // -------------------注册本地通知-----------------// 创建一个本地通知对象UILocalNotification *localNotification = [ ...

  5. iOS 通信通知 Communication Notifications 的实现

    背景 看到群里有同学在咨询,推送通知如何自定义左侧的icon 部位,因为iOS 10之后有推出,通知扩展,所以大家知道可以通过Notification Extension 可以给通知添加媒体资源即图片 ...

  6. 通信通知 Communication Notifications 的实现 (iOS 15+)

    WWDC 2021 苹果在 iOS 15 系统中对通知做了很多改变, 让通知更加个性化. 这里只有讨论通信通知 Communication Notifications, 苹果自带的很多应用, 以及第三 ...

  7. 用于显示本地通知的跨平台插件flutter_local_notifications

    用于显示本地通知的跨平台插件. https://pub.flutter-io.cn/packages/flutter_local_notifications 在这里插入图片描述

  8. SSH的端口转发:本地转发Local Forward和远程转发Remote Forward

    http://zhumeng8337797.blog.163.com/blog/static/100768914201172125444948/ 实战 SSH 端口转发 https://www.ibm ...

  9. iOS开发之本地通知UILocalNotification

    本地通知是UILocalNotification的实例,主要有三类属性: scheduled time:时间周期,用来指定iOS系统发送通知的日期和时间: notification type:通知类型 ...

最新文章

  1. mysql常见增量恢复方式_MySQL 全备份与增量备份 全恢复与增量恢复
  2. SQL SERVER 2000写存储过程出现列名无效的解决方法
  3. 在 Jenkins 中使用声明式 Pipeline 构建 Android 项目
  4. 【源资讯 第24期】有人总想搞大新闻:“Windows 11”爆猛料;微信放出“小程序码”...
  5. 银屑病与寿命的关系(调研手稿七)
  6. rabbitnq 源码安装_linux下源码安装rabbitMq
  7. linux命令创建硬链接,Linux终端命令接口(十一)硬链接与软连接
  8. Synchronized 的 8 种使用场景!
  9. springboot 监听所有异常_SpringBoot——目前Java开发最流行的框架(一)
  10. ecplise git修改提交信息_Git提交信息规范化
  11. 《变革中的思索》各路读者评论
  12. Spark 0.9.1 MLLib 机器学习库简介
  13. 【实用】CSS Border使用小分享——盒模型
  14. Linux CentOS 7 下 安装SimHei字体
  15. ios开发-教程选择
  16. 微信linux 下载文件夹,把Windows下微信文件夹复制到Deepin-WeChat目录以更新微信
  17. 腾讯手机管家android版,腾讯手机管家上线Android8.11.0版本
  18. gitbub(cp:http://www.linuxidc.com/Linux/2014-03/97821.htm)
  19. 2021年最新3d材质贴图素材大合集来咯
  20. mac被限制什么意思_苹果ip完美解决电脑ip被限制问题

热门文章

  1. python的使用涉及侵权吗_只要不用于商业用途就不算侵权吗
  2. Jpg文件格式[参考]
  3. 洛谷 P1078 文化之旅
  4. 理解熵(信息熵,交叉熵,相对熵)
  5. UWA内存管理篇_常识(三)
  6. 响铃:新零售迷上了形象类IP,搭便车,还是打错了车?
  7. Qt跨平台开发编程技巧总结
  8. 毕业答辩一定会被问的问题
  9. 输电线路导线舞动在线监测装置
  10. 20世纪最著名的逆向投资者,从1万美元做到220亿美元!