ios 8 background service ends after 15 to 20 mins - ios

IOS 8 stops background call after 15 min.
I am using background service to send gps to service every 2 mins. app sending data properly for 15 min after that its stops sending data. this happens only in ipad mini, in rest of ipad its working fine, data going properly eben for 8 hours.
iOS 8 background service ends after 15 to 20 mins. I am testing in iPad mini, but its working fine in normal iPad, I had enabled background app refresh, and everything fine. but its not working after 20 min, but same code working fine in other device except iPad mini, I am using iPad mini cellular ? kindly help me out.

The usual cause for this is an app crash. I had it happen when my background refresh ran over the allowed 30 seconds. Then the app appears to still be running when you reactivate it, but in fact it's restarted.
Check the device logs and see if you've had crashes like this. Given the date, you probably already solved your problem.
Also remember that iOS calls for BG refresh when it wants, and it's very idiosyncratic.

Related

iPhone 12 Pro debugging on device hangs

Like many of you I received my iPhone 12 pro today in the mail! And of course the first thing I wanted to do was run it in debug on my actual device. Curious if any of you with new iPhone 12's, or iPhone 12 pro's are seeing a huge lag when trying to debug to the device. for example it takes almost 1 min to even hit the entry point in the app delegate, and about 20 seconds when given focus to a uitextview for the keyboard to show up (after the 1st time the keyboard loads, the subsequent ones are instant)
Its super crazy because the simulator is instant, all other actual devices (Xs etc) are instant (all on 14.1), but my brand new 12 pro is unworkable when debugging to it.
Any suggestions? Ive tried multiple projects, seems to do it on every one. Ive submitted a feedback as well.
Disconnect the device, then delete the contents of ~/Library/Developer/Xcode/iOS DeviceSupport and restart Xcode.

(iOS Swift) Some features work on simulator but not on device

I'm making an alarm app. There are two things that work on the simulator but not on my device.
1) According to this website, if UIApplicationExitsOnSuspend is set to "YES", then the app should always be running even if the device is locked (provided that it's in foreground). I used this information to make sure that NSTimer runs even if device is locked. On the simulator, no matter how much time passes by (even like 10+ hours) the NSTimer always works and the sound always fires (even if I lock the simulator screen). When I connect my iPhone device to the computer and run the app through xcode it works well too. But the problem is that as soon as I disconnect my phone and load the saved app, sometimes the NSTimer works and sometimes it doesn't.
2) Local Notifications: On the simulator the local notifications work well but on the iPhone device the notifications are fired at random times and sometimes they don't even fire. But on the simulator the local notifications fire accurately. I tested in different ways (such as setting local notification to fire 20 seconds after app loads and then exiting the app to be in background mode) but it doesn't fire on the specified time and like I said it sometimes doesn't even fire.
In such case, should I trust simulator or the iPhone device? Could this be a bug or is it something I'm doing wrong?
Always trust the device. After all, that's how the end user is going to run your app!
It is well known that you should not trust the Simulator for background behavior. The NSTimer issue is an excellent example. The problem is that the Simulator is your computer, not an iOS device. Timers do not in fact run in the background; the Simulator is misleading you. (The issue where the app behaves differently on the device if being run from Xcode vs. being run independently is a bit more suprising, but in this case I suppose it isn't all that surprising; you were very clever to think of testing both ways.)
And of course there are lots of iOS features that don't work on the Simulator at all.
I figured out the problem for #2. I simply canceled previous notifications before firing new ones.
I'm still facing issues with the first problem.

iOS app launch time is around 10 seconds

My App is taking around 10 seconds to launch.
To be clear, 10 seconds is the time between when i press the app icon and splash screen appears.
I have tried to put timer on main and didFinishLaunchingWithOptions calls. but it seems that these are getting called after the 10 seconds only.
To add some more details here,
This is the update of the app. Previous version of the app was/is working fine on the same device (iOS 8.3 OS), But not the current app.
The main difference between the two updates (except few new features which come into effect after launch only) is the change in the coredata-model.
For which , I have added a new dataModel-filename_2.xcdatamodel file.
Any idea/suggestions on how can I fix this launch time issue?
Edit: Just to add, I am not facing this issue on the "iOS 9". But there is one "iOS 8" iPad on which I am seeing this issue to the extent that app takes long to even come up from background (not just fresh launch). But Can't generalize this, I have tested on 2 devices only.

Only few iPhone 6s - failed to return after waiting 10 seconds

I am having this really really strange issue where only on one iPhone 6s running iOS 9.0.2 (my friend's), my app basically just freezes right after launching. Sometimes the app works a few seconds and completely freezes. Sometimes it freezes right after launching.
015-10-13 17:47:02.542 Musicbot[1638:1057192] void SendDelegateMessage(NSInvocation *): delegate (webView:resource:didFinishLoadingFromDataSource:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
2015-10-13 17:47:12.544 Musicbot[1638:1057192] void SendDelegateMessage(NSInvocation *): delegate (webView:resource:didFinishLoadingFromDataSource:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
The error makes no sense because my app has no webViews. I even searched for UIWebView or didFinishLoadingFromDataSource in the entire app and zero hits in my app code. It's a pure objective c app.
I have tried removing almost all functionality of the app and it still freezes after a few seconds. I look at the memory and as soon as it freezes, it starts climbing up in 30MB chunks. It even reaches around 900 MB when it's killed by iOS. (iPhone 6s has 2gigs memory I believe).
After all this, I bought myself an iPhone 6s and tested the app on it. It works perfectly find on mine with no issues. Then I upgraded it to 9.0.2 and it still works perfectly find on it.
I have thousands of downloads and no one has reported this issue - though I am not sure if reviews from iPhone 6s or 9.0.2 are coming in yet at app store? So I am pretty much lost on what's happening.
My app so far has worked perfectly fine on 4s, iPhone 5 (my old one) and 5s and iPhone 6 which my brother has. Only my friend's iPhone 6s is having the issue as far as I know.
How should I even go about troubleshooting this?

iPhone 4s not receiving iBeacon notifications in background

iPhone 4s not receiving iBeacon notifications in background.
I have an app that acts as an iBeacon and also scans for them.Using an iPhone 5, iPad Air, and iPad mini Retina I get the notifications in the foreground and background.
One of our testers has a 4s and apparently only gets notifications in the foreground. It can apparently take up to 15 minutes to deliver the notification and apparently it is not arriving in that time frame. For background modes I have location updates, external accessory communication, uses bluetooth LE accessories and acts as bluetooth le accessory.
I also have notifyEntryStateOnDisplay set to YES. What is weird is that it does work as expected on all devices so I am curious if anyone else has seen this issue.
Currently I am confirming that:
a) It is for sure a 4s.
b) That background use is on for that app.
c) Will get a 4s tomorrow to try hands on.
This is really tricky to test, so I would try it yourself and not rely on reports of a "tester". When you get your 4s, if you do not see background notifications in 15 min of an iBeacon showing up, try hitting the shoulder button and verifying you get it right away.
If this does not help, I'd suggest:
Post your code that produces this problem so others can try.
Try to run the code in the github project referenced in my blog post here and see if that code triggers within 15 min.
If the code in (2) works, there might be an issue in how you are setting it up.

Resources