简体   繁体   English

针对iOS 11设备使用Xcode 9构建的应用程序的间歇性和晚期重要位置更改事件

[英]Intermittent and late Significant Location change events on apps built with Xcode 9 for iOS 11 devices

I have filed a radar on this already but I wanted to see if anyone else had this issue. 我已经对此提出了雷达,但我想知道是否有其他人有这个问题。

It appears as though significant location changes (SLCs) are behaving differently on iOS 11 but only on apps that are built on Xcode 9. It appears as though SLCs are performing much worse and are delayed when compared to iOS 10. I can back this up with data from multiple devices and an easily reproducible experiment. 似乎重要的位置更改(SLC)在iOS 11上表现不同,但仅限于在Xcode 9上构建的应用程序。看起来好像SLC表现得更糟,并且与iOS 10相比延迟了。我可以支持这个使用来自多个设备的数据和易于重复的实验。 I wanted to try and keep this post short so if anyone wants more data or instructions on how to reproduce the issue in more detail, I'm happy to share exactly how I did all of this. 我想尝试保持这篇文章的简短,所以如果有人想要更多关于如何更详细地重现这个问题的数据或说明,我很高兴能够分享我是如何完成这一切的。

Using this minimalistic SLC caching app: https://github.com/Root-App/root-ios-slc-tester I was able to get data from iOS 10 and iOS 11 devices. 使用这个简约的SLC缓存应用程序: https//github.com/Root-App/root-ios-slc-tester我能够从iOS 10和iOS 11设备获取数据。

The problem exists ONLY on iOS 11 devices where the app receiving SLCs has been built on Xcode 9. Just to make sure this is clear: 问题仅存在于iOS 11设备上,其中接收SLC的应用程序已构建在Xcode 9上。只是为了确保这一点清楚:

  • iOS 10 device + app built on Xcode 9: works like before 在Xcode 9上构建的iOS 10设备+应用程序:像以前一样工作
  • iOS 10 device + app built on Xcode 8: works like before 在Xcode 8上构建的iOS 10设备+应用程序:像以前一样工作
  • iOS 11 device + app built on Xcode 8: works like before 在Xcode 8上构建的iOS 11设备+应用程序:像以前一样工作
  • iOS 11 device + app built on Xcode 9: issue exists 在Xcode 9上构建的iOS 11设备+应用程序存在问题

A majority of the time (but not always), SLCs on the iOS 11 + Xcode 9 build happen significantly later than SLCs on the control (iOS 10) devices. 大多数时候(但并非总是如此),iOS 11 + Xcode 9版本上的SLC发生的时间明显晚于控制(iOS 10)设备上的SLC。

Comparing the log files from the above app, the iOS 10 devices get SLCs more than 2 minutes before the iOS 11 devices. 比较来自上述应用程序的日志文件,iOS 10设备在iOS 11设备之前超过2分钟获得SLC。 Sometimes 10-15 minutes before! 有时10-15分钟前!

Sample abridged data where each line is a different trip and represents the first time that an SLC was recorded for that trip (in HH:mm:ss): 样本删节数据,其中每一行是不同的行程,并表示第一次记录该行程的SLC(以HH:mm:ss):

 iOS 10  |  iOS 11
-------------------
20:41:08 | 20:44:45
07:21:25 | 07:27:48
18:54:57 | 19:07:36
07:48:17 | 07:51:03
17:29:44 | 17:38:18

The gaps between when there was an SLC in iOS 10 vs iOS 11 seems unacceptably different. iOS 10与iOS 11中存在SLC之间的差距似乎有所不同。

Is anyone else seeing this degraded SLC behavior? 是否有其他人看到这种降级的SLC行为?

If you only use “While Using” location access, as far as I understand nothing changes for you. 如果你只使用“使用时”位置访问,据我所知,没有任何改变。

If you use the “Always” access though, and you didn't provide a “While Using” fallback as you should have. 如果你使用“始终”访问权限,并且没有像你应该提供的那样“提供使用时”。

Below Information may be useful for iOS 11, 以下信息可能对iOS 11有用,

As Brad Jensen explains in the WWDC talk I mentioned, Apple has decided that forcing the user to give the app “Always” location access is a bad user experience: 正如Brad Jensen在我提到的WWDC演讲中解释的那样,Apple决定强迫用户给应用程序“始终”位置访问是一种糟糕的用户体验:

Now, a second reason we think that many developers choose to require Always authorization is they're simply trying to give their users the best possible experience (…) but this makes for a very poor user experience for the users that don't wish to grant the app Always authorization. 现在,我们认为许多开发人员选择要求始终授权的第二个原因是他们只是试图为用户提供最佳体验(...)但这对于不希望用户的用户来说会带来非常糟糕的用户体验。授予应用程序始终授权。 They are forced to choose between granting the app Always, which is more than they would like in this example, or granting it Never, which means they don't get to benefit from any of the app's location-based features. 他们被迫在批准应用程序Always之间做出选择,这比他们在这个例子中所希望的要多,或者授予它Never,这意味着他们无法从应用程序的任何基于位置的功能中受益。 And their final option is to grant it Always and then revoke that authorization after they're done using the app. 他们的最终选择是授予它Always,然后在使用该应用程序完成后撤销该授权。 In any case, the user is not having a great time with this app. 在任何情况下,用户都没有很好的时间使用这个应用程序。

For more details you can read from below blog it's may be more useful, 有关详细信息,您可以从下面的博客中了解它可能更有用,

https://mackuba.eu/2017/07/13/changes-to-location-tracking-in-ios-11/ https://mackuba.eu/2017/07/13/changes-to-location-tracking-in-ios-11/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM