uibackgroundtask

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

☆樱花仙子☆ 提交于 2020-01-04 02:56:10
问题 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 screen is turned on. But if the screen is turned off then the timer is not working and the app is not executing as expected. This is the code in AppDelegate to start a timer in background: func startTimerWith(timeInterval: TimeInterval) {

XTubeManager crash in background?

↘锁芯ラ 提交于 2019-12-21 04:18:26
问题 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, therefore no console logs are written, do you think this is a possibility? Do I have to handle backgroundTask expiration differently, e.g. by cancelling all my NSURLRequests ? (see code below) Background I am regularly waking up in the background (or

IOS:Call method when local notification is received in background

戏子无情 提交于 2019-12-11 10:36:09
问题 I know this question looks duplicate but i did not found the exact answer as per my requirement.Doing app related to medical events with Below steps followed 1) connected the app to smart watch. 2) schedule the local notifications i. e when user needs to take medicine 3) when the schedule time arrives local notification fires and delegate method is calling (did receive local notification) 4) At the time of firing local notifications i am sending message(sms) to the user from the app that he

Keep just one background task

一个人想着一个人 提交于 2019-12-08 07:19:30
问题 I'm developing an application that uses a background task to keep tracking of the user position every 20 seconds. All is fine, except that when I enter the application in background, a new background tasks is created, so that I can have in final multiple background tasks that are running. I tried to add [[UIApplication sharedApplication] endBackgroundTask:bgTask]; in applicationWillEnterForeground , but that do nothing. The point is that I want to invalidate/disable all running background

App killed by OS in ios7 after some seconds -edit

回眸只為那壹抹淺笑 提交于 2019-12-08 02:34:34
问题 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 Pushnotification with didReceiveRemoteNotification fetchCompletionHandler: method, I have successfully implement this Using Silent Pushnotification & it Call startUpdatingLocation and I am able to get location data in delegate method : Using This Payload: {

iBeacon Region monitoring: Not resumed when rebooting the phone EXCEPT if I set location background mode?

百般思念 提交于 2019-12-06 13:22:54
问题 all day I tested the monitoring of beacons my app does. in general it works ok: notifications in foreground work notifications in background work BUT after a reboot it doesn't work until I launch ANY app that uses BluetoothLE after I do that it works fine for my app as well! But if I set UIBackgroundMode location in my plist though, my app gets region notifications just fine even after a reboot. So... is that it? or whats the deal here? :D this is under ios 7.1.1 btw The code is very minimal:

Trying to implement beginBackgroundTaskWithExpirationHandler and UILocalNotification

百般思念 提交于 2019-12-03 17:38:54
问题 I have the following code in my AppDelegate for when my application enters the background: var backgroundUpdateTask: UIBackgroundTaskIdentifier! func beginBackgroundUpdateTask() { self.backgroundUpdateTask = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler({ self.endBackgroundUpdateTask() }) } func endBackgroundUpdateTask() { UIApplication.sharedApplication().endBackgroundTask(self.backgroundUpdateTask) self.backgroundUpdateTask = UIBackgroundTaskInvalid } func

startUpdatingLocation of LocationManager through silent push notification

谁都会走 提交于 2019-12-03 10:20:53
问题 I am creating app that needs to wake up in background at particular time . I have tried : UILocalNotification : But i Don't want to use UILocalNotification because it needs user interaction to tap on notification and than only app will wake up and start location manager. I have also used [locationManager startUpdatingLocation]; enabled with background Modes Location updates, this is works but it will take lot of battery. So with using new iOS 7 feature Silent pushNotification and

Maintain a Multipeer Connectivity session in Background via BackgroundTask?

房东的猫 提交于 2019-12-03 10:04:09
问题 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 session with the UIBackgroundTask, can someone please post a hint I don't care about the advertisers/browsers, it's okay to stop them, but I'd like the session to not disconnect as reconnecting is super buggy for the moment. 回答1: As per apple

Trying to implement beginBackgroundTaskWithExpirationHandler and UILocalNotification

五迷三道 提交于 2019-12-03 06:51:41
I have the following code in my AppDelegate for when my application enters the background: var backgroundUpdateTask: UIBackgroundTaskIdentifier! func beginBackgroundUpdateTask() { self.backgroundUpdateTask = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler({ self.endBackgroundUpdateTask() }) } func endBackgroundUpdateTask() { UIApplication.sharedApplication().endBackgroundTask(self.backgroundUpdateTask) self.backgroundUpdateTask = UIBackgroundTaskInvalid } func doBackgroundTask() { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { self