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有很多功能无法实现,于是对其进行了一层包装.相当于手动管理观察者栈和监听者期望执行的事件,因此可以为其添加了很多新增的功能,将 ...
随机推荐
- 使用阿里云加速docker镜像的安装
刚接触docker,尝试安装node镜像.docker运行在win7中,安装完Docker Toolbox之后简单敲了docker pull node命令,然后就是漫长的等待了… 等待的结果就是nod ...
- Android学习笔记之Toast详解
1. 贴一段Android API-Toast Toast public class Toast extends Object java.lang.Object ↳ android.widget.T ...
- Centos6.x搭建lnmp环境
查看系统版本 #cat /etc/redhat-release CentOS release 6.7 (Final) 配置静态ip #vi /etc/sysconfig/network-scripts ...
- RBM
1. 玻尔兹曼分布: $$p(E) \thicksim e^{-E/kT} $$ 2. RBM 两层:隐层和可视层, $\mathbf v$, $\mathbf h$ $$v_i \in \{0, 1 ...
- php simple_html_dom
这个真的很好用,如果用正则,就太麻烦了. 首先,下载simple_html_dom,用include_once就可以使用了. 可以直接定位,可以像个对象一样操作,很方便. $ret=file_get_ ...
- BZOJ2724 蒲公英 【分块】
BZOJ2724 蒲公英 题目背景 亲爱的哥哥: 你在那个城市里面过得好吗? 我在家里面最近很开心呢.昨天晚上奶奶给我讲了那个叫「绝望」的大坏蛋的故事的说!它把人们的房子和田地搞坏,还有好多小朋友也被 ...
- 如何向整个 Git 仓库补提交一个文件
微软在 Reference Source 里开放了 .Net Framework 多个版本的源码.为了更方便地阅读这些源码,我们把每一个版本都下载下来后按顺序提交到 git 仓库中. 但是!!!居然忘 ...
- 《selenium2 python 自动化测试实战》(7)——定位一组对象
定位一组对象 定位一组对象——find_elements_by_...(),注意,这里是elements,复数.返回的结果是一个列表,我们取值的时候就要用列表取值的方式来获得自己想要的元素.需要注意的 ...
- mac版sublime 无法下载插件(Vue 代码无高亮问题)
1.官方下载sublime(http://www.sublimetext.com/3) 然后需要两步(1)上传插件主包Package Control(2)更改channels的配置信息(原来是国外的需 ...
- WebApi全局异常处理方式
自定义错误消息 public class ErrorMessage:DelegatingHandler { protected override Task<HttpResponseMessage ...