[英]Delphi Firemonkey ios Background Fetch
i'm trying to use delphi Firemonkey to develop an iphone App. 我正在尝试使用delphi Firemonkey开发iphone应用程序。 I need to download an xml every x minutes and process it, if there are new data send notification.
如果有新的数据发送通知,我需要每隔X分钟下载一个xml并进行处理。 It's very easy if the app is in use, but i can't find the way to use this procedure when the app is in background....
如果应用程序正在使用中,这非常容易,但是当应用程序在后台时,我找不到使用此过程的方法。
Please help me... 请帮我...
Tnx a lot...But i can't do this.... this is my simpliest code that doesn't work... What is my error??? Tnx很多...但是我不能这样做....这是我最简单的代码,不起作用...我的错误是什么???
procedure TForm1.Button1Click(Sender: TObject);
var
IdHTTP1 : TIdHTTP;
MyFile : TFileStream;
Notification: TNotification;
UIApp : UIApplication;
begin
UIApp := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
UIApp.setIdleTimerDisabled(True);
TThread.CreateAnonymousThread(procedure ()
var
I: Integer;
Total: Integer;
begin
Total := 0;
while true do
begin
// Carico l'XML
MyFile:= TFileStream.Create(TPath.GetDocumentsPath + TPath.DirectorySeparatorChar+'listticket',fmCreate);
IdHTTP1 := TIdHTTP.Create(nil);
IdHTTP1.Get('http://www.google.com', MyFile);
IdHTTP1.Free;
MyFile.Free;
end;
sleep(5*60*1000);
TThread.Synchronize (TThread.CurrentThread,
procedure ()
begin
end);
end).Start;
end;
See these articles to get you started. 请参阅这些文章以帮助您入门。
Disable The IOS Device Idle Time Out In Your Delphi XE5 Firemonkey App 在Delphi XE5 Firemonkey应用程序中禁用IOS设备空闲超时
Programatically Disable the Idle Timer on iOS using the ObjectiveC Bridge 使用ObjectiveC Bridge在iOS上以编程方式禁用空闲计时器
Providing background services support to your iOS apps with Delphi 使用Delphi为您的iOS应用提供后台服务支持
Handle Android And IOS Lifecycle Events In Delphi XE5 Firemonkey 在Delphi XE5 Firemonkey中处理Android和IOS生命周期事件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.