I'm writing a VoIP app on iOS.I set the 'voip' and 'audio' UIBackgroundModes properties for my project and I called setKeepAliveTimeout successfully, but, sometimes, after the specified time, my app is not be waken up and the handler is not be called.However, it's OK sometimes. Does someone met this yet?I got no clues for the reason.
Asked
Active
Viewed 688 times
1
-
Possible duplication: http://stackoverflow.com/questions/17787202/voip-app-is-not-wake-up-in-time-if-set-15-min-for-setkeepalivetimeout-method – Dhaval Bhadania Nov 28 '13 at 04:03
-
it's not the same situation, my app seems never wake up once it go to background instead of waking up irregular or not in time. – XiangmeiNorth Nov 28 '13 at 05:49
-
Recenlty I have experienced the same issue. Did you happen to fix this? Or maybe have some clues why this happens? – user1264176 Jan 13 '14 at 09:20
-
No,I haven't met this for quite a long time, but I met this again a few days ago.I'm still searching for some clues but hasn't found any...what an annoying problem! – XiangmeiNorth Jan 14 '14 at 02:43
1 Answers
0
Well, this might be too late for an answer but still just for the future reference.
I had the same problem. I was setting keep alive timer when app went to background.
The problem is that sometimes voip app starts in background and thus my timer setting in applicationDidEnterBackground
code was never called and app was just going to sleep after some period.
So I have added this code to app did finish launching.
// in application:didFinishLaunchingWithOptions:
if (application.applicationState == UIApplicationStateBackground) {
[self setupKeepAliveTimer:application]; // setup timer as you need
}
I hope that helps someone.

user1264176
- 1,118
- 1
- 9
- 26