background-fetch

Background Fetch at Specific Time

筅森魡賤 提交于 2019-12-04 17:38:21
问题 I am looking for solution to get data in background mode even app is terminated. There are lots of tutorials and answers available for this questions, but my questions is different than other. I haven't find any proper solution on stackoverflow, so posted this question. I have scenario which I can explain. I'm using realm database which store event date, name, time, address etc. Now the thing is that, I want to write a code which are execute in background, In this code I want to get all event

Background Fetch Does Not Appear to Fire

若如初见. 提交于 2019-12-04 15:41:20
First I really appreciate all of the wonderful inputs and comments by all on Stack Overflow. I have read many contributions but have not been able to contribute directly until now. In my app, I have performed the following listed below and have added counter to the app fetch routine to highlight the number of times fetch is called by iOS 8.1. Turned on Background Modes and enabled background fetch. Wrote code for “performFetchWithCompletionHandler”. NSLog message indicate the start and end of the fetch process. Counters are between these messages. Added code in “didFinishLaunchingWithOptions”.

Background Fetch at Specific Time

戏子无情 提交于 2019-12-03 10:29:46
I am looking for solution to get data in background mode even app is terminated. There are lots of tutorials and answers available for this questions, but my questions is different than other. I haven't find any proper solution on stackoverflow, so posted this question. I have scenario which I can explain. I'm using realm database which store event date, name, time, address etc. Now the thing is that, I want to write a code which are execute in background, In this code I want to get all event data and compare their date with today's date. And based on days remaining between these days fire

PerformFetchWithCompletionHandler called twice when simulating with Xcode

旧城冷巷雨未停 提交于 2019-12-02 21:37:57
In Xcode 7.0.1 the "simulate background" fetch command causes performFetchWithCompletionHandler to be triggered twice. Is this an Xcode debugging error, or can this happen on a device running a release build of the application. Update Now we have Xcode 7.1.1 and still performFetchWithCompletionHandler is called twice. Since I am not sure if this also happens "in the wild" I am keeping a state if my fetch action is already running. - (void)application:(UIApplication *)application performFetchWithCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler { if (self

Using URLSession and background fetch together with remote notifications using firebase

心已入冬 提交于 2019-12-02 05:16:24
I am trying to implement a basic func here which will be called when my app is backgrounded or suspended. In reality, we aim to send about 5 a day so Apple should not throttle our utilisation. I've put together the following which uses firebase and userNotifications, for now, it is in my app delegate. import Firebase import FirebaseMessaging import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var backgroundSessionCompletionHandler: (() -> Void)? lazy var downloadsSession: Foundation.URLSession = { let configuration =

Background fetch is not working after killing the app

蓝咒 提交于 2019-11-30 18:38:36
I'm trying to get data from url with background fetch. My func tries to get data and if there is a new data, it sends local notification. Background fetch works after about 10 - 20 minutes when i minimize the app. But when i kill the app (double click home button and close app) it doesn't work. I waited about 1 hour but it didn't work. I am using background service in android and it is working successfully. Is there any way to get data from url and send local notification when app is closed? I am using Xcode 6 and swift 1.2 Alex The Background Fetching will NOT happen in your app after the

iOS background fetch custom interval

好久不见. 提交于 2019-11-30 08:34:30
问题 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, but if I set it like this: [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:21600]; Does that mean that fetch will happen every 6h? 回答1: No, it means that you are suggesting to iOS that at least six hours should elapse before a

Background fetch is not working after killing the app

我的未来我决定 提交于 2019-11-30 03:09:40
问题 I'm trying to get data from url with background fetch. My func tries to get data and if there is a new data, it sends local notification. Background fetch works after about 10 - 20 minutes when i minimize the app. But when i kill the app (double click home button and close app) it doesn't work. I waited about 1 hour but it didn't work. I am using background service in android and it is working successfully. Is there any way to get data from url and send local notification when app is closed?

iOS background fetch custom interval

寵の児 提交于 2019-11-29 10:33:12
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, but if I set it like this: [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:21600]; Does that mean that fetch will happen every 6h? No, it means that you are suggesting to iOS that at least six hours should elapse before a background fetch is performed, but the documentation for this property states - The minimum number of seconds

iOS background fetch

蹲街弑〆低调 提交于 2019-11-29 08:22:39
I'm little bit confused with background fetch. I read in Apple Developer documentation that fetch happens when OS decides that it should, user can't control background fetch, while on Apple Developer forum post by Apple employee says that if user kills app (double tap on home and button swipe up) background fetch wont happen, in that case user can control background fetch. So can someone please clarify to me if user kills the app with task manager will background fetch still continue in the background or it's killed at the same time as app. Apple documentation: https://developer.apple.com