         locationManager.requestWhenInUseAuthorization()
         
         self.locationManager.startUpdatingLocation()
+        
+        NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleBackgroundNotification:", name: UIApplicationWillResignActiveNotification, object: nil)
+        
+        NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleForegroundNotification:", name: UIApplicationDidBecomeActiveNotification, object: nil)
     }
     
     // MARK: - Public


import Foundation
import CoreLocation

public typealias LocationResult = Result<Location>
public typealias Observer = (location: LocationResult) -> ()

    
    // MARK: - Private
    
    func handleBackgroundNotification(notification: NSNotification) {
        self.locationManager.stopUpdatingLocation()
    }
    
    func handleForegroundNotification(notification: NSNotification) {
        self.locationManager.startUpdatingLocation()
    }
    
    private func publishChangeWithResult(result: LocationResult) {
        if self.shouldUpdateWithResult(result) {
            observers.map { (observer) -> Void in
