On iOS, I want to register tasks to be performed in a few hours to a few tens of days, and move the registered tasks even if the application process is turned off.

Asked 2 years ago, Updated 2 years ago, 39 views

iOS app

I have looked into various items below.However, I couldn't find anything to do what I wanted to do.

  • DispatchQueue
    • I was able to run in the background, but when I turned off the app process, it stopped working.
  • UIBackgroundTaskIdentifier
    • I was able to run in the background, but when I turned off the app process, it stopped working.
  • BackgroundExecution
  • queuing
  • I was able to run in the background, but when I turned off the app process, it stopped working.
  • I was able to run in the background, but when I turned off the app process, it stopped working.

I would appreciate your help.Thank you for your cooperation.

swift ios objective-c

2022-09-30 15:01

1 Answers

The short answer is "I can't do that on iOS."

In more detail, it is as follows.

iOS's general app does not allow the app to handle such background reservations alone.

Sending a push notification called サイsilent push 」 (push notification of only attached data without a message) allows the receiving terminal to take some action, but this is also not guaranteed to take place at the time of receipt of the push notification.

If time is not particularly important and your purpose is to retrieve the latest data, you can use a background process called "background fetch."The background fetch cannot be run on a date or time, it can only be run on the minimum interval between fetches, mainly when the battery is less burdensome, such as while connected to Wi-Fi or charging.

The "swip up and turn off the app" behavior is considered to be a denial of explicit app behavior (including background behavior) by the user.Therefore, it is highly likely that the aforementioned "silent push" and "background fetch" will not be performed after an explicit process termination.


2022-09-30 15:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.