Hey,I am having issues with the BGProcessingTaskRequest.earliestBeginDate property.If I use this property, my tasks are never started. Even if I wait for 24hours, with screen off and plugged in.In this example I use 15 Minutes from now:class func schedule() {
let request = BGProcessingTaskRequest(identifier: TASK_IDENTIFIER)
request.requiresExternalPower = false
request.requiresNetworkConnectivity = false
request.earliestBeginDate = Date(timeIntervalSinceNow: 15*60)
do {
try BGTaskScheduler.shared.submit(request)
} catch {
print("Could not schedule task: \(error)")
}
}But if I don’t set the property earliestBeginDate and keep it at nil, my task is run without problems.I reproduces this 3 times and the task was run after 12 Minutes, 17Minutes and 12 Minutes.One more question: What happens to my tasks if I reenter my App before the task was run? Will they be canceled or still run?Sometimes I see following messages in the device syslog when I reenter the app before the task was run:Jun 10 08:23:05 Tims-iPhone My App(DuetActivityScheduler)[4118] : Will expire BGTask activities: {(
)}
Jun 10 08:23:05 Tims-iPhone My App(BackgroundTasks)[4118] : Will expire activities: {(
)}
Jun 10 08:23:05 Tims-iPhone My App(BackgroundTasks)[4118] : Calling expiration handlers for activities: {(
)}
Jun 10 08:23:05 Tims-iPhone My App(BackgroundTasks)[4118] : Calling expiration handlers for tasks: {(
)}My Task identifier is not present in this log messages, so I guess it is not affected?
Post
Replies
Boosts
Views
Activity
When I am creating a Provisioning Profile for platform „iOS“ and type „Development“, there is a checkbox „Include Mac Devices“.
It seems like this checkbox does not do anything. I have Macs registered as Devices, but they are not appearing here.
I am expecting that they appear in the list, after activating the checkbox.
What is the expected behavior here?
Context:
I try to distribute an iOS App for testing on Macs using:
Xcode Organizer -> Distribute App -> Development