The application is configured to receive location updates in the background to keep the application active and receive updates when the application is in the background.
Darwin notifications have also been configured and are only accepted when the application is the current application in the foreground. Once the application is placed in the background image, it will stop receiving Darwin notifications.
Any thoughts on how to get Darwin notifications when the app is in the background?
The following are snippets of code.
Creating an Application in Swift2
in appdeligate
let callback: @convention(c) (CFNotificationCenter!, UnsafeMutablePointer<Void>, CFString!, UnsafePointer<Void>, CFDictionary!) -> Void = { (center, observer, name, object, userInfo) in
in viewcontroller
locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest
source share