1

I'm working on a VOIP project.

My app uses reachability to listen when the connection changes and to re-register with SIP SERVER. Everything works well when the app is in the foreground.

But when My App enters the background, it can't catch connection changes. At least 10 minutes later (when keepAlive runs) my app can check the connection again.

I intend to look at connection changes (lost wifi, 3G change to wifi, wifi to 3G, ...) using a private framework and mobile substrate. I've tried many methods but have not found a working one yet.

Does anyone know which method will be called when connection changes ?

Thank you

beroe
  • 11,784
  • 5
  • 34
  • 79
Tran Quan
  • 1,056
  • 15
  • 28
  • Have you look at the Reachability example provided by Apple? This pretty much solves your problem of catching connection changes: https://developer.apple.com/library/ios/samplecode/Reachability/Introduction/Intro.html. And you should also read the Tips for implementing a VoIP app, in order to allow your app to maintain a persistent connection to SIP Server even in the background: https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW12 – Raúl Juárez Sep 10 '13 at 16:26

3 Answers3

2

i think only Reachability class is better for this even apple use this class for his code please see this Link in this code you find. you answer some how

Jignesh B
  • 490
  • 7
  • 18
1

I found a question from someone going through a similar scenario:

How to get Reachability Notifications in iOS in Background when dropping Wi-Fi network?

Hope this helps.

Community
  • 1
  • 1
Paradox
  • 94
  • 6
-1

Make sure your app is setup to do VoIP in the background. In your Info.plist file. Add the following key value pair:

enter image description here

See also: https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

nrj
  • 1,701
  • 2
  • 22
  • 37