title: How does iOS Google Map detect I am entering a car?
body: <p>The latest iOS Google Map application(currently of version 4.9.0) has a very nice feature, but so far I can not figure out how this is possible.</p>
  
  <p>The feature is: whenever I am entering my car, try to drive somewhere, Google map will send me a notification to my phone, guess where I am going, giving me an estimate of the traffic, even when the phone is in locked state, and the Google map app hasn't been used for days. A screenshot is provied as following:</p>
  
  <p><a href="https://i.stack.imgur.com/ttBU1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ttBU1.jpg" alt="Google Map push notification"></a></p>
  
  <p>This is quite amazing to me as an iOS developer. How can it live in the background and detect I am entering a car with such accuracy?</p>
  
  <p>One of my guess is, Google map is using significant location change API. By using this way, the app can be waken in background mode, but, there is still no guarantee it is waken when I am entering my car. And I have already written a test app using this mechanism, although it can be waken in the background, but the timing is not correct, failed to detect I am entering a car or not.</p>
  
  <p><a href="https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/#//apple_ref/occ/instm/CLLocationManager/startMonitoringSignificantLocationChanges" rel="nofollow noreferrer">CLLocationManager Class Reference</a></p>
  
  <blockquote>
    <p>If you start this service and your app is subsequently terminated, the system automatically relaunches the app into the background if a new event arrives. In such a case, the options dictionary passed to the application:willFinishLaunchingWithOptions: and application:didFinishLaunchingWithOptions: methods of your app delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your app was launched because of a location event. Upon relaunch, you must still configure a location manager object and call this method to continue receiving location events. When you restart location services, the current event is delivered to your delegate immediately. In addition, the location property of your location manager object is populated with the most recent location object even before you start location services.</p>
  </blockquote>
  
  <p>Any suggestion and help appreciated.</p>