Questions tagged [background-fetch]

Background fetch is a background execution mode on iOS 7 and newer, used for apps that regularly update their content by contacting a server can register with the system and be launched periodically to retrieve that content in the background.

Background fetch is a background execution mode on iOS 7 and newer, used for apps that regularly update their content by contacting a server can register with the system and be launched periodically to retrieve that content in the background.

Documentation:

238 questions
8
votes
3 answers

Will performFetchWithCompletionHandler be called if the app has been terminated

It's surprisingly difficult to find a definitive answer to this; couldn't find it mentioned in the Apple documentation and couldn't find a definite yes/no after searching past questions. The question is simple - if the app requests a background…
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
8
votes
6 answers

How to fetch data in background every hour in Swift even the app is terminated?

I am making an app that provides functionality to fetch data every hour. It fetches data even when the app terminates. How can I implement this functionality? After a lot searching I found background fetching using performFetchWithCompletionHandler.…
Jack.Right
  • 974
  • 3
  • 14
  • 30
8
votes
3 answers

iOS background fetch custom interval

I read all Apple documentation about background fetch and currently I'm using it like this: [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:minimumBackgroundFetchInterval]; I let OS to decide when to perform background fetch,…
user3251
  • 83
  • 1
  • 1
  • 3
7
votes
4 answers

Flutter access database in background fetch on Android

I am trying to access the local database on the device while the app is completely closed, to achieve this I am using the sqlite plugin sqflite: ^1.2.0 and the background fetch plugin background_fetch: ^0.4.0. I am able to register the headless…
Billy Mahmood
  • 1,857
  • 5
  • 26
  • 37
7
votes
2 answers

iOS: server calls in background often lead to timeout

My app makes some server calls whenever it is started, now I face a weird problem: when a push notification with content_available wakes up my app the calls are made as well, but more often than not they run into a timeout. Does this have to do with…
swalkner
  • 16,679
  • 31
  • 123
  • 210
7
votes
1 answer

How often is background fetch executed in iOS?

In iOS 7, a background fetch mode is supported for apps to fetch data when the app is not frontmost: When it is convenient to do so, the system launches or resumes the app in the background and gives it a small amount of time to download any new…
NeoWang
  • 17,361
  • 24
  • 78
  • 126
6
votes
1 answer

Send silent push notification to app, update location and send to server in background

I want to send a silent push notification to an application that is in background, then fetch the current user location and send it to a web service. I implemented push notification methods and also those two: - (void)application:(UIApplication…
ytpm
  • 4,962
  • 6
  • 56
  • 113
5
votes
1 answer

Does Flutter Background Fetch work on iOS when the app is terminated?

I'm building a Flutter app and need to call a function every day (to schedule some notifications). I came across the flutter_background_fetch package, which seems to be a perfect solution for Android, since the main limitation of the minimum 15…
nhjx
  • 51
  • 1
  • 4
5
votes
1 answer

Flutter Backgroundfetch on iOS doesn't fire

I'm trying to develop an app with flutter that uses the background_fetch package https://pub.dev/packages/background_fetch to connect within a specific time period to a BLE device and receives some status data. On Android, everything works fine and…
A.h.
  • 111
  • 7
5
votes
1 answer

I get a warning saying that the completion handler was never called When I simulate a Background fetch

I followed all the steps in order to set up the background fetch but I'm suspecting that I made a mistake when writing the function performFetchWithCompletionHandlerin the AppDelegate. Here is the warning that I get as soon as I simulate a…
AziCode
  • 2,510
  • 6
  • 27
  • 53
5
votes
1 answer

Should I call setMinimumBackgroundFetchInterval every time the app restarts?

I developed an app that uses background fetch. I set the minimum interval between updates to minimum: [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum]; I thought that this value is…
FreeNickname
  • 7,398
  • 2
  • 30
  • 60
5
votes
2 answers

What are the best practices for multiple async requests in background-fetch?

I have an app that can have more than one user account. I need to update all of them in background. The problem is: time is limited (~30 sec but requests may take longer than that) all requests are asynchronous When should I call a completion…
Jarod
  • 485
  • 5
  • 16
5
votes
4 answers

How can I detect my app was launched for background fetch in didFinishLaunchingWithOptions method?

I want to check whether my app was launched for background fetch in my application delegate's didFinishLaunchingWithOptions. There is nothing in launchOptions dictionary. So is there any way to check it? I know that I can check applicationState, but…
tagirkaZ
  • 469
  • 7
  • 19
5
votes
0 answers

iOS background fetch on app launch causes black screen

I have been successfully using background fetch in the iOS app I'm developing, but I've noticed a strange bug that I'm having trouble squashing. The initial symptom was that sometimes when I launched the app, the launch image would show, and then be…
johntvolk
  • 76
  • 4
4
votes
0 answers

How to observe photo library changes even when app is closed?

I need to be notified when a photo/video is taken, even when my app is closed. Does anybody know how apps like Google Photos achieve this in iOS? So far, I have implemented and registered PHPhotoLibraryChangeObserver however photoLibraryDidChange…
1
2
3
15 16