
function beginBackgroundTaskWithExpirationHandler(handler: TBackgroundTaskHandler): UIBackgroundTaskIdentifier; cdecl; procedure endBackgroundTask(identifier: UIBackgroundTaskIdentifier); cdecl;
The demo, wraps the two methods and provides easy and convenient integration. The implementation applies to Delphi 10 Berlin with FireMonkey. Here is a small sample of the demo implementation, just to give an idea and stir your interest to study it in more detail. This method is not related to UIBackgroundModes.
function TBackgroundTaskManager.Start: Boolean;
begin
FTaskID := SharedApplication.beginBackgroundTaskWithExpirationHandler(DoExpiry);
Result := IsValidTask;
end;
procedure TBackgroundTaskManager.Stop;
begin
if IsValidTask then
SharedApplication.endBackgroundTask(FTaskID);
Reset;
end;
Head over and check out the demo for IOS Background Applications for Delphi Berlin with FireMonkey.
Mirror: Download the background IOS demo for Delphi 10 Berlin.
