Questions tagged [bgtaskscheduler]

18 questions
6
votes
1 answer

Cannot find 'BGTaskScheduler' in scope

Anyone knows how to fix this error in ios swift Cannot find 'BGTaskScheduler' in scope i am trying to run background task where i am using BGTaskScheduler
3
votes
1 answer

Using BGTaskScheduler API with new iOS 14 App. How to register tasks without an AppDelegate?

I'm using the BGTaskScheduler API to register background tasks in my iOS 14 app which is using the new App as @Main instead of an AppDelegate. I thought we were to use scenePhase as below to mimic the previous function of didFinishLaunching in…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
2
votes
1 answer

BGTaskScheduler: Is it possible to schedule a background task inside a background task?

Let's say an app has a background task to execute after 1 hour, but when it executes, it discovers that the user has no internet connection, so it cannot do its job. Is it possible to schedule another background task inside the background task to…
infoMining
  • 91
  • 7
2
votes
0 answers

iOS long task in background

After reading several similar questions I don't find anything that fits into my problem. I have an app that analyzes CSV files (some kind of big data analyzer app). So far CSV files were small and the analysis didn't take too long. But now we need…
Wonton
  • 1,033
  • 16
  • 33
2
votes
0 answers

How to use BGTaskScheduler to make API call in background in swift?

In my app, One service we have to call to refresh the token. So for that thinking to use background scheduler and schedule task for calling API. In that, scheduled task I have to make silent call in background which provides new token. So when user…
VRAwesome
  • 4,721
  • 5
  • 27
  • 52
1
vote
0 answers

BGTaskRequest if task fails, would system reschedule it

I am curious as to whether the iOS cares if the task I scheduled failed to succeed, eg a network call to backend server. If I set the boolean to false for setTaskCompleted(success:), would the system retry my task at a later time?
infoMining
  • 91
  • 7
1
vote
0 answers

BGTaskRequest earlestBeginDate maximum time possible

I am interested in understanding what is the farthest future date in time you can schedule a BGTask. For example is it possible to schedule on 7 days from now? Also, what if the user has not opened the app for 7 days, does this affect the system…
infoMining
  • 91
  • 7
1
vote
0 answers

How to pass json argument to a BGTaskScheduler

I would start a background task and give it an arguments which can be a json string. On Android we can use something like : val oneOffTaskRequest = OneTimeWorkRequest.Builder(BackgroundWorker::class.java) …
Eng
  • 1,617
  • 2
  • 12
  • 25
1
vote
1 answer

Can anyone help getting BGTaskScheduler implemented in swiftui?

hope everyones doing well! I've been trying to implement BGTaskScheduler so that my app can refresh a feed in the background and schedule some local notifications. I've read over pretty much every article/question I can find on BGTaskScheduler and I…
Al McIver
  • 43
  • 1
  • 4
1
vote
1 answer

how to test in ios device about bgtaskscheduler function not using debug function

i have no problem when using debug function in my ios device not simulator. (ex, e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"TASK_IDENTIFIER"] ) but when do not using debug function, follow my code,…
HGM K
  • 11
  • 1
1
vote
0 answers

BGProcessingTask Terminated due to Signal 9

I'm scheduling a long-running, suspendable, CPU heavy ML inference task to be run when device is on power with BGProcessingTask. According to Apple, I'm supposed to get unlimited CPU for a couple minutes, then a few seconds to stop with the…
Ryan Tremblay
  • 169
  • 1
  • 3
  • 12
0
votes
0 answers

iOS background task every 15 minutes

How can I create an API call, and when got the response a local push every 15 minutes, when the app is closed or in the background? I tried BGTaskScheduler but it not triggered 15 minutes. I do not what is the logic, but triggered sometime in a 20…
0
votes
0 answers

How to test BGTaskScheduler in App (with out using debugger)

I have a BGTaskScheduler scheduled for background process. It is running in debugger mode but not working with out debugger. I have tried to test it on TestFlight as well, did not work. I have tested it with the help of private function provider by…
Ankita
  • 1
0
votes
1 answer

Is BackGroundTasks good option for making network call and send notification in a SwiftUI App

I am relatively new to Swift and currently writing an app on SwiftUI. My app makes a network call, lists buy/sell orders on different products, showing orders with different quantities and prices. The market is open for 4 hours on weekdays. I want…
iosdevok
  • 1
  • 1
0
votes
0 answers

Periodic IOS Background execution

An app has some periodic light background work, which is expected to run even when app is suspended. Ofc, if user has swiped up, nothing can be done. When swiped from app switcher, if app was in Suspended state, it is not informed, else, in every…
NightFuryLxD
  • 847
  • 5
  • 15
1
2