gpt4 book ai didi

ios - iOS 谷歌地图如何检测到我正在上车?

转载 作者:可可西里 更新时间:2023-11-01 04:43:37 25 4
gpt4 key购买 nike

最新的 iOS 谷歌地图应用程序(目前版本为 4.9.0)有一个非常好的功能,但到目前为止我还不知道这是怎么可能的。

功能是:每当我进入我的车,试图开车去某个地方,谷歌地图会给我的手机发送一个通知,猜测我要去哪里,给我一个交通估计,即使手机处于开机状态锁定状态,并且谷歌地图应用程序已经好几天没有使用了。截图如下:

Google Map push notification

作为一名 iOS 开发人员,这让我感到非常惊讶。它如何能够在后台运行并检测到我正在进入汽车并如此准确?

我的一个猜测是,Google map 正在使用重要的位置更改 API。通过这种方式,应用程序可以在后台模式下被唤醒,但是,仍然不能保证当我进入我的车时它被唤醒。而且我已经用这个机制写了一个测试app,虽然可以在后台唤醒,但是时间不对,没能检测到我是不是在上车。

CLLocationManager Class Reference

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.

感谢任何建议和帮助。

最佳答案

@alexkent 的一条评论指出了我的错误。这是苹果的 Maps.app,不是谷歌地图。所有学分都属于@alexkent。

That notification is from Apple's Maps.app not Google Maps. A new feature in iOS9 (which you must be running) is the ability to detect when you are in your car. I imagine this is done by detecting the Bluetooth signal from the car radio (I have not checked this). I do not believe there is developer API available for this feature.

关于ios - iOS 谷歌地图如何检测到我正在上车?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31957299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com