Posts

Post not yet marked as solved
0 Replies
395 Views
I have an application which connect with a peripheral (bluetooth device) in background and perform some task in background. As per the developer documentation I am following what are the best practices for background modes but interval at which the refresh task is fired is not consistent sometimes it takes 8 hours and sometimes happens in 40 minutes. Since the time interval is not consistent its not solving my purpose of what I am trying to achieve as part of this implementation. Below are the things I'm doing for this flow. Register for Refresh Task on Application launch with refresh time interval 30 minutes. Application is sent to background start the background refresh task. When application is in background and refresh task is called we make an API to check if the bluetooth device in proximity is same as received from API we connect with the device and fetch some data. We upload this data with POST API call in background. We are using background URL session configuration for this GET call (3) and POST call to upload the data using download data task and upload data task. We are handling the callback through delegates and not through closures (as per best practices). Questions How to make sure the time interval between fetch is consistent? If the application is installed for the first time does it takes time to get the user behavior by neural engine before it starts performing frequent refresh tasks Is long gaps expected between intervals? Is there are way to prioritize the tasks? Is there a way by which we can perform this behavior described above in more frequent manner? Other than background refresh and background process tasks? If there are frequent updates like 2 refresh cycles in an hour will the OS delay the third (just as an example) refresh task at some later time. Like some rate limit on how often the refresh task is called??
Posted Last updated
.