W
W
wolfak2017-08-03 12:38:32
Swift
wolfak, 2017-08-03 12:38:32

How to implement background execution of tasks?

Hello. Can you please tell me how to implement the ability to run a certain function of the application (for example, checking the number of new messages and displaying a new notification) in the background in Swift 3? So that this function works not only when the application is minimized, but also when it is not even running. I dealt with Background Fetch, but the interval is set there is generally incomprehensible, the function is either executed or not. In addition, I'm not sure that it will work when the application is not even running. I ask you to direct me in the right direction and share a detailed manual, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Beltyukov, 2017-08-10
@wolfak

iOS apps have a very rigid approach to background mode. Background fetch is really suitable for your tasks. However, there are 2 points:
1. The system itself chooses the frequency of launching the application. You can influence her "preferences" by making a request as soon as possible and returning a message that you have downloaded new data.
2. an application that the user killed with his hands (thrown out of the tray) will not start at all for fetch.
Because of all this, the correct approach is for the server to notify the application through pushes, rather than the application itself verifying the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question