I have implemented CTCallCenter and getting the eventhandler call when app is in the foreground. is there any way my app gets called when its not in the memory or in the background.
Also looked at How to get a call event using CTCallCenter:setCallEventHandler: that occurred while the app was suspended?
func block (call:CTCall!) {
NSUserDefaults.standardUserDefaults().setValue(call.callState, forKey:"state")
NSUserDefaults.standardUserDefaults().synchronize()
println(call.callState)
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
println(NSUserDefaults.standardUserDefaults().valueForKey("state"))
callcenter.callEventHandler = block
return true
}
use case: i want to have a LED turn on when i get a call. just to show the status. Will not be uploading to the app store so don't have to worry about app getting rejected.