delphi IOS 通知 TNotification
delphi IOS 通知 TNotification
http://blogs.embarcadero.com/ao/2013/05/01/39450
TNotification
http://docwiki.embarcadero.com/CodeExamples/Seattle/en/FMX.Notification.Mac_%28Delphi%29
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Mobile_Tutorial:_Using_Notifications_%28iOS_and_Android%29
unit Unit1; interface uses
System.SysUtils, System.Classes, FMX.Forms, FMX.Platform; type TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function AppEvent(AAppEvent: TApplicationEvent; AContext: TObject) : Boolean;
end; var
Form1: TForm1; implementation {$R *.fmx} uses
FMX.Notification; procedure SendNotification;
var
NotificationService: IFMXNotificationCenter;
Notification: TNotification;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXNotificationCenter) then
NotificationService := TPlatformServices.Current.GetPlatformService(IFMXNotificationCenter) as IFMXNotificationCenter; if Assigned(NotificationService) then begin
Notification := TNotification.Create;
try
Notification.Name := 'MyLocalNotification';
Notification.AlertBody := 'Hello from the Delphi XE4 iOS app that you used 5 seconds ago!';
Notification.FireDate := Now + EncodeTime(,,,);
NotificationService.ScheduleNotification(Notification);
finally
Notification.DisposeOf;
end;
end
end; function TForm1.AppEvent(AAppEvent: TApplicationEvent; AContext: TObject) : Boolean;
begin
if AAppEvent = TApplicationEvent.aeEnteredBackground then
SendNotification;
end; procedure TForm1.FormCreate(Sender: TObject);
var
AppEventSvc: IFMXApplicationEventService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(AppEventSvc)) then
AppEventSvc.SetApplicationEventHandler(AppEvent);
end; end.
TNotification
delphi
Notification:= notificationcenter1.createnotification;
c++
TNotification *not=NotificationCenter1->createNotification();
delphi IOS 通知 TNotification的更多相关文章
- 苹果开发证书相关BLOG与Delphi IOS环境安装(超详细)
注:有好的资源,请添加了上传,上传后,通知管理员,删除旧文件,累积相关的学习资源,方便新手学习 一.相关论坛http://www.2ccc.com/ delphi 合子 www.2pascal.com ...
- iOS通知的整理笔记
iOS通知用于高耦合界面的传值确实方便快捷. 需要实现模态弹出的视图控制器上,有一个视图控制器可以导航.这必定要将这个视图控制器的导航视图控制器naVC.view添加到模态弹出的视图控制器presen ...
- iOS 通知的变化ios9-10,新功能展示
二.新功能展示 1 使用 /iOS通知新功能玩法 2. 全面 iOS10里的通知与推送详情 一.变化 四.Notification(通知) 自从Notification被引入之后,苹果就不断的 ...
- delphi ios info.plist
delphi ios info.plist delphi修改info.plist.TemplateiOS.xml文件,然后自动生成project1.info.plist http://docwiki. ...
- iOS通知中心
iOS通知中心 它是iOS程序内部的一种消息广播机制,通过它,可以实现无引用关系的对象之间的通信.通知中心他是基于观察者模式,它只能进行程序内部通信,不能跨应用程序进程通信. 当通知中心接受到消息后会 ...
- Delphi IOS 蓝牙锁屏后台运行
Delphi IOS 后台运行 同样的程序,编译成android,锁屏后继续运行正常,蓝牙通讯正常,但在IOS下锁屏后程序的蓝牙就中断通讯了? IOS的机制就是这样,锁屏就关闭了. 音乐播放器是怎么做 ...
- iOS 通知观察者的被调函数不一定运行在主线程
Tony in iOS | 08/08/2013 iOS 通知观察者的被调函数不一定运行在主线程 今天修复Bug时候发现的一个小细节,记录下. 问题描述 事情是这样的:我在A视图(UITableVie ...
- iOS 通知扩展插件
iOS 通知扩展插件 目录 iOS 通知扩展插件 Notification Service Extension 新建一个target 代码实现 注意事项 UINotificationConentExt ...
- iOS通知中心升级 -可设置按优先级执行block
简单介绍下,这是需求驱动中发现iOS的NotificationCenter有很多功能无法实现,于是对其进行了一层包装.相当于手动管理观察者栈和监听者期望执行的事件,因此可以为其添加了很多新增的功能,将 ...
随机推荐
- CentOS7 firewalld设置端口
Centos升级到7之后,发现无法使用iptables控制Linuxs的端口,google之后发现Centos 7使用firewalld代替了原来的iptables.下面记录如何使用firewalld ...
- python发送邮件的实例代码(支持html、图片、附件)
转自http://www.jb51.net/article/34498.htm 第一段代码 #!/usr/bin/python# -*- coding: utf-8 -*- import emaili ...
- selenium python实例脚本1
#!/usr/local/bin/python3 # coding=utf-8 #统一编码from selenium import webdriverfrom time import sleep#im ...
- Maven系列(二)之安装和配置详解
检查JDK环境 在安装Maven之前,首先要确认你已经正确安装了JDK.Maven可以运行在JDK 1.4及以上的版本上. 打开cmd输入: java -version 下载Maven Maven官网 ...
- mysql update select 用法
之前用SqlServer , update语句对表进行更新:update a set a.xx= (select yy from b) ; 是可以的但是在mysql中,不能直接使用set select ...
- 学习Selenium同学必看
本文转载 作者:灰蓝蓝蓝蓝蓝蓝链接:http://www.jianshu.com/p/5188cb3ab790來源:简书著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.更多技术博客 ...
- 顺丰品牌研究http://www.kiees.cn/sf/express/brand.htm
顺丰控股股份有限公司,顺丰速运SF,始于1993年,国内速递行业中民族品牌的佼佼者,以其速度快/安全性能高蜚声业界,现已开通海外快递服务,2017年2月完成借壳上市 1993年,顺丰诞生于广东顺德.自 ...
- [LeetCode系列]卡特兰数(Catalan Number) 在求解独特二叉搜寻树(Unique Binary Search Tree)中的应用分析
本文原题: LeetCode. 给定 n, 求解独特二叉搜寻树 (binary search trees) 的个数. 什么是二叉搜寻树? 二叉查找树(Binary Search Tree),或者是一棵 ...
- oracle表空间维护常用命令
---查看表空间的名字及文件所在位置: select tablespace_name, file_id, file_name,round(bytes/(1024*1024),0) total_spac ...
- 总结css的使用技巧
1. 纯 CSS 的 tooltips 现在的要求是使用纯css在页面上显示一个title,或者图片的描述文字(在鼠标移入图片之后): content,attr() content一般与::befor ...