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有很多功能无法实现,于是对其进行了一层包装.相当于手动管理观察者栈和监听者期望执行的事件,因此可以为其添加了很多新增的功能,将 ...
随机推荐
- HDU - 5876 :Sparse Graph (完全图的补图的最短路 -BFS&set)
In graph theory, the complement of a graph G is a graph H on the same vertices such that two distinc ...
- threeJs中旋转位移等操作坐标系
1.场景中的立方体.圆柱等三维模型的位置属性.平移方法参照Scene对象的世界坐标系 2.场景中立方体.圆柱等的三维模型的角度属性.旋转方法参照模型自身的模型坐标系
- querySelector.. 方法相比 getElementsBy..
querySelectorAll 返回的是一个 Static Node List,而 getElementsBy 系列的返回的是一个 Live Node List. 看看下面这个经典的例子 [5]: ...
- BZOJ4237 稻草人 【CDQ分治】
Description JOI村有一片荒地,上面竖着N个稻草人,村民们每年多次在稻草人们的周围举行祭典. 有一次,JOI村的村长听到了稻草人们的启示,计划在荒地中开垦一片田地.和启示中的一样,田地需要 ...
- Linux系统下位(Ubuntu 11.04) 下安装配置 JDK 7安装步骤指导
第一步:下载jdk下载内容为:jdk分为:jdk-7-linux-i586.tar.gzjdk-7u51-linux-x64.tar.gz(适合64位Linux操作系统) hadoop版本为:hado ...
- python(一):python语言基础
一.python语言基本的8个要素 Python语言的8个要素:数据类型.对象引用.组合数据类型.逻辑操作符.运算操作符.控制流语句.输入/输出.函数的创建与引用.除此之外还有一个非常重要且无处不在的 ...
- For input string: "null"
java.lang.NumberFormatException: For input string: "null" 在开发中你是否遇到过这样的问题,不管请求到的值是什么都能进入不为 ...
- MySQL安装与操作总结
安装MySQL 添加mysql源 # rpm -Uvh http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm 安装mysq ...
- WebSocket的使用
WebSocket是长连接,如果客户端的程序没有数据实时同步的需求就没必要使用它.因为长连接会带来一定的服务器内存开销.如果Ajax就能轻松搞定的话就完全没必要兴师动众的搞WebSocket. htt ...
- springboot: 使web项目支持jsp
1.springboot为什么不推荐使用jsp? 参考地址:https://spring.io/blog/2012/10/30/spring-mvc-from-jsp-and-tiles-to-thy ...