You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to be able to register a single and periodic task:
registerSingleTask
String id
String taskName
String tag
Enum existingWorkPolicy:
keep
replace
TimeInterval initialDelay
Enum constraints:
requiresNetworkConnectivity
requiresExternalPower
Enum backoffPolicy
exponential
linear
TimeInterval backoffPolicyDelay
String inputData
registerPeriodicTask
TimeInterval frequency
String id
String taskName
String tag
Enum existingWorkPolicy:
keep
replace
TimeInterval initialDelay
Enum constraints:
requiresNetworkConnectivity
requiresExternalPower
Enum backoffPolicy
exponential
linear
TimeInterval backoffPolicyDelay
String inputData
We'll start with supporting only BGProcessingTaskRequest for now. Later we can look at BGAppRefreshTaskRequest.
Internally we'll need to keep a complete state of the different tasks.
We need to keep a reference to the tasks in order to know how to behave when a new registration comes in with the same id. Depending on the existingWorkPolicy, the previously registered task needs to be left alone or resubmitted. We also want to be able to cancel all requests with a certain tag. If a task fails it needs to be resubmitted based on the backoffPolicy and backoffPolicyDelay.
For periodic tasks there is a frequency property. Meaning that after each succesful 'run' of the task a new task needs to be submitted with an earliestBeginDate calculated using the frequency that was passed along.
The system runs only tasks registered with identifiers on a whitelist of task identifiers. To add the whitelist, add the identifiers to the Info.plist file.
This is something we'll need to clearly mention in our documentation.
@Kymer@olivierscalais JFYI: I'm actively working on our (Open-Xchange) fork of this manager for our Open Source Flutter project OX COI Messenger. I made lots of changes and already added registration for App Refresh Tasks. Please see here.
Hi guys. Your project seems to be the only one so far trying to leverage iOS BackgroundTask API.
Is there any progress on this already or was the project frozen so far?
We want to be able to register a single and periodic task:
registerSingleTask
String
idString
taskNameString
tagEnum
existingWorkPolicy:TimeInterval
initialDelayEnum
constraints:Enum
backoffPolicyTimeInterval
backoffPolicyDelayString
inputDataregisterPeriodicTask
TimeInterval
frequencyString
idString
taskNameString
tagEnum
existingWorkPolicy:TimeInterval
initialDelayEnum
constraints:Enum
backoffPolicyTimeInterval
backoffPolicyDelayString
inputDataWe'll start with supporting only
BGProcessingTaskRequest
for now. Later we can look atBGAppRefreshTaskRequest
.Internally we'll need to keep a complete state of the different tasks.
We need to keep a reference to the tasks in order to know how to behave when a new registration comes in with the same id. Depending on the existingWorkPolicy, the previously registered task needs to be left alone or resubmitted. We also want to be able to cancel all requests with a certain tag. If a task fails it needs to be resubmitted based on the
backoffPolicy
andbackoffPolicyDelay
.For periodic tasks there is a
frequency
property. Meaning that after each succesful 'run' of the task a new task needs to be submitted with an earliestBeginDate calculated using thefrequency
that was passed along.General notes from BGTaskScheduler class docs:
This is something we'll need to clearly mention in our documentation.
From BGTaskScheduler submit(_:) docs:
Useful links:
The text was updated successfully, but these errors were encountered: