Questions tagged [uibackgroundtask]

69 questions
12
votes
1 answer

Trying to implement beginBackgroundTaskWithExpirationHandler and UILocalNotification

I have the following code in my AppDelegate for when my application enters the background: var backgroundUpdateTask: UIBackgroundTaskIdentifier! func beginBackgroundUpdateTask() { self.backgroundUpdateTask =…
gotnull
  • 26,454
  • 22
  • 137
  • 203
9
votes
1 answer

iOS13 can't support the background update notification?

iOS13 can't support the background update notification.Is this an OS-level bug? And when app enter background,the Xcode warning shows: Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended.…
YongJie
  • 119
  • 1
  • 7
8
votes
1 answer

XTubeManager crash in background?

I am experiencing a large amount of crashes in the XTubeManager (seems to be CFNetwork internal). Unfortunately the console logs are not available, only the call stack (see below). Questions: I could imagine that my app crashes in the background,…
MarkHim
  • 5,686
  • 5
  • 32
  • 64
7
votes
5 answers

beginBackgroundTaskWithExpirationHandler calling endBackgroundTask but not ending process

I have some long running process which I want to run even if application goes in background. I am calling application's beginBackgroundTaskWithExpirationHandler: method and in the expirationBlock I am calling application's endBackgroundTask. Here is…
Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100
7
votes
2 answers

Maintain a Multipeer Connectivity session in Background via BackgroundTask?

I am trying to maintain a MultipeerConnectivity "session" when the application enters temporarily in the background, so I thought about using a background task as I've seen few times here ... The problem is I have no idea how to "maintain" the…
Einho
  • 311
  • 3
  • 15
5
votes
3 answers

Background task not calling class in Swift

I have a background task that should return an array of courses that is then sent to the apple watch. I'm calling the task inside didReceiveMessage via WatchConnectivity. The background task needs to perform a few operations such as opening the…
user7684436
  • 697
  • 14
  • 39
5
votes
1 answer

Dispatch call to main queue inside UIBackgroundTaskIdentifier

I am running a certain task under UIBackgroundTaskIdentifier since i want to run it in background. My code looks something like this. -(void) function { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ …
4
votes
3 answers

Swift4.2 Type 'UIBackgroundTaskIdentifier' (aka 'Int') has no member 'invalid'

I'm getting a weird issue where code which works in one XCode project fails to compile in another. Both run Swift4.2. Why do I get "UIBackgroundTaskIdentifier has no member 'invalid' error? import UIKit import Foundation //Type…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
4
votes
0 answers

When app goes to background speech recognition not working

I am using SFSpeechRecognition for speech to text, its working properly when application is on foreground but application required continues recording when app goes to background too. I tired all required background setting in .plist file -…
4
votes
3 answers

Apple programming guide for iOS background execution guide example?

So on this page there is an example about background execution: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW1,…
MegaManX
  • 8,766
  • 12
  • 51
  • 83
3
votes
2 answers

Timers not running when screen is turned off / device is locked in iOS

The app is in the background and it receives a callback upon disconnection with the BLE device, after which the app has to wait for sometime(1minute) and then execute some piece of code. The app behaves as expected even when in the background if the…
3
votes
2 answers

iOS11 watchdog timeout crashes (0x8badf00d) but code not on stack

I am debugging user reports of our app repeatedly exiting while in the background starting in iOS11, even during active use (for example, the user backgrounds us and returns within a few seconds or a minute, only to find it restarted). Crash logs…
esilver
  • 27,713
  • 23
  • 122
  • 168
3
votes
1 answer

iOS app "has active assertions beyond permitted time - occasional crashes"

Some of my users are getting this crash (according to them, it happens after 4-5 minutes of using the app) but I can't reproduce it myself: Application Specific Information: has…
Z S
  • 7,039
  • 12
  • 53
  • 105
3
votes
1 answer

How can I know which tasks are running in the background?

I'm trying to implement a seemingly common feature in my app: to upload files in the background. I run such tasks by calling -[UIApplication beginBackgroundTaskWithExpirationHandler:], so those tasks are each identified by a…
craftsman
  • 15,133
  • 17
  • 70
  • 86
3
votes
3 answers

App killed by OS in ios7 after some seconds -edit

I am creating navigation based app for iOS 7, for it I am taking users location data, Using CoreLocation framework, App requirement is to start getting users location in background at particular time, For that I have implemented Silent…
user2265763
1
2 3 4 5