-
After analysis I came to conclusion that this issue is caused by iOS scheduling mechanism for background fetch tasks. From what I read, iOS allows background fetch task to be executed only for 30 seconds and our tasks were using 20s if at least one account was not connected. Moreover iOS uses execution time to measure power usage of background task and will reduce frequency of task being executed if task takes long time to complete.
Our 20s were close to 30s limit and every request for background fetch used 20 seconds.
I changed mechanism to reconnect as fast as possible and complete this background fetch task as soon as possible. In my typical use it reduced time from 20s to 5-6s per fetch request. This improvement should be taken into account by iOS scheduling mechanism which should allow our app to execute background fetch task more often.
-
%kobit I've tried many different possible options to ask iOS to allow our application to be waken up every X minutes. If I'm correct iOS counts every second in which application is running in background and based on that it estimates energy usage. If this usage is higher it decides to run application in background less often or even never.
To deal with that I tried to reduce time needed for connection to server and retrieval of messages and I got from 25 seconds to 6-8 seconds on average request. Unfortunately iOS still denies to call our application every X minutes and even stops calling it at all. I already sent you an email about that and we concluded that only option to deal with this for good is to use PUSH.
Type |
Bug
|
Priority |
Normal
|
Assignee | |
RedmineID |
4662
|
Version |
Public testflight version.
|
For some unknown yet reason Messenger is not runned every 15 minutes and in some cases it is not runned in background even for more than an hour which leads to disconnection.
We need to investigate this issue to find root cause of it and fix it if possible.