background-fetch

iOS10 Background fetch

China☆狼群 提交于 2019-12-18 02:42:13
问题 I have tried to implement background fetch, to hopefully can wake the app from time to time. I have done these: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { application.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum) return true } func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) ->

iOS11 swift silent push (background fetch, didReceiveRemoteNotification) is not working anymore

岁酱吖の 提交于 2019-12-17 09:42:15
问题 I was hoping that the iOS11 release will fix the silent push issue, which was in the latest betas and GM version of iOS. Currently I'm struggling to understand, why I don't receive any silent push messages, which should actually wake up my app to perform some needed tasks in the background. In iOS 10 I just use the background fetch capability and implemented the 'wake-up-code' in my AppDelegate like the code below. In iOS 11 the registering code is still working fine and my backend is also

Background fetch not working

一笑奈何 提交于 2019-12-13 01:39:04
问题 I'm having a problem getting Background fetch to work. See my code below. I added fetch as background mode in info.plist. I simulate the fetch using Debug -> Simulate background fetch. Nothing is output in the console log. I couldn't find any good examples of this in swift. Does anyone know how to get this working? func application(application: UIApplication!, performFetchWithCompletionHandler completionHandler: ((UIBackgroundFetchResult) -> Void)!) { println("Background fetch occured!");

IOS remote silent notification is not working during phone calls / network fluctuation

血红的双手。 提交于 2019-12-12 19:18:05
问题 I am developing the iOS application where I am doing the background work. I am awaking the app by sending the silent notification. The code is working fine most of the time. The issue is during the phone call app is not awaking, even during the low network connectivity or during network fluctuation app is not awaking. I am doing the following things: 1: Enabled 2 background mode i) Background fetch. ii)Remote notification. 2: Sending notification as: { aps: { content-available: 1, sound: ""

Will performFetchWithCompletionHandler be called if the app has been terminated

半世苍凉 提交于 2019-12-10 13:09:33
问题 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 fetch to be performed after N time, then the user terminates the app. Will the OS still launch the app into the background to perform the background fetch? 回答1: Okay, once again background modes cause confusion. No offense to the other people trying to

How to properly use the completionHandler when performing a background fetch?

假如想象 提交于 2019-12-08 04:32:02
问题 I'm having a hard time wrapping my head around using completionHandler inside performFetchWithCompletionHandler in the AppDelegate . My App does some background fetching, and during the fetch I would like to invoke a function that is located in one of my viewControllers What is the correct way to use the completionHandler , I'm aware that it is an asynchronous task. I managed to make it work when I wanted to send data to my database, but I'm unable to make it work when I want to invoke a

IOS Firebase background fetch

醉酒当歌 提交于 2019-12-07 20:05:10
问题 I'm having trouble using background fetch on swift 2.0 according to the tutorial -> https://www.raywenderlich.com/92428/background-modes-ios-swift-tutorial3. I get this error: application:performFetchWithCompletionHandler: but the completion handler was never called. Basically i have a function where i perform my actions (calling data on firebase) and i want it to execute on background. Here is my app delegate code func application(application: UIApplication, didFinishLaunchingWithOptions

How to properly use the completionHandler when performing a background fetch?

戏子无情 提交于 2019-12-07 11:27:29
I'm having a hard time wrapping my head around using completionHandler inside performFetchWithCompletionHandler in the AppDelegate . My App does some background fetching, and during the fetch I would like to invoke a function that is located in one of my viewControllers What is the correct way to use the completionHandler , I'm aware that it is an asynchronous task. I managed to make it work when I wanted to send data to my database, but I'm unable to make it work when I want to invoke a function located in one of the viewControllers Attempt : What is the right way to call completionHandler ?

IOS Firebase background fetch

非 Y 不嫁゛ 提交于 2019-12-06 11:38:49
I'm having trouble using background fetch on swift 2.0 according to the tutorial -> https://www.raywenderlich.com/92428/background-modes-ios-swift-tutorial3 . I get this error: application:performFetchWithCompletionHandler: but the completion handler was never called. Basically i have a function where i perform my actions (calling data on firebase) and i want it to execute on background. Here is my app delegate code func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { UIApplication.sharedApplication()

Background Fetch Does Not Appear to Fire

廉价感情. 提交于 2019-12-06 08:27:17
问题 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