Contents

submit(_:)

Submit a previously registered background task for execution.

Declaration

func submit(_ taskRequest: BGTaskRequest) throws

Parameters

  • taskRequest:

    A background task request object specifying the task identifier and optional configuration information.

Mentioned in

Discussion

Submitting a task request for an unexecuted task that’s already in the queue replaces the previous task request.

There can be a total of 1 refresh task and 10 processing tasks scheduled at any time. Trying to schedule more tasks returns BGTaskScheduler.Error.Code.tooManyPendingTaskRequests.

See Also

Scheduling a task