简体   繁体   English

应用程序在后台处理模拟器但不在设备上时更新位置(iOS 9)

[英]Updating locations while app in background working on simulator but not on device (iOS 9)

I have enabled Background Modes > Location updates in my target's capabilites. 我已在目标的功能中启用了Background Modes > Location updates I run the app in an iOS 9 simulator, I put the app in background state with Location > City run in the simulator, and it seems to keep getting location updates. 我在iOS 9模拟器中运行应用程序,我将应用程序置于背景状态, Location > City run在模拟器中Location > City run ,它似乎不断获取位置更新。 But I run the app in a real iOS 9 device and few seconds after going to background, I loose the location services arrow in the status bar and no location updates are received. 但是我在真正的iOS 9设备中运行应用程序,在转到后台几秒后,我松开了状态栏中的位置服务箭头,并且没有收到位置更新。

On the other hand, I've run the app in a real iOS 8 device and it seems to keep listening for locations (the arrow in the status bar does not disappear). 另一方面,我在真正的iOS 8设备上运行应用程序,它似乎一直在监听位置(状态栏中的箭头不会消失)。

Why are location services stopping in background in an iOS 9 real iPhone ? 为什么位置服务在iOS 9真正的iPhone停留在后台?

I need help to solve this, thanks in advance. 我需要帮助解决这个问题,提前谢谢。

With iOS 9 you also need to set allowsBackgroundLocationUpdates to yes . 使用iOS 9,您还需要将allowsBackgroundLocationUpdates设置为yes See the docs here 请参阅此处的文档

暂无
暂无

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

相关问题 背景音频在iOS模拟器上可运行,但不能在设备上运行 - background audio working on iOS simulator but not device iOS应用程序在模拟器中以后台模式工作,但在设备中不工作吗? - iOS app works in background mode in simulator but not in device? iOS 应用程序链接在设备上不起作用,但在模拟器上打开应用程序 - iOS applink not working on the device but opens app on simulator iOS数据库应用程序(phonegap)-在模拟器上运行,但在设备上不运行 - IOS database app(phonegap)- working on simulator but not working on device iOS App Receipt验证 - 调试时模拟器和设备上缺少收据 - iOS App Receipt Validation - Receipt is missing in simulator and on device while debugging phonegap iOS应用程序可在模拟器上运行,但不能在设备上运行。 如何调试 - phonegap iOS app working on simulator but not in device. How to debug Expo 应用程序在 Expo Go 和 iOS 模拟器上工作,但在真实设备上崩溃 - Expo app working on Expo Go and iOS Simulator but crashes on real device iOS 通用应用程序链接在模拟器上工作,而不是在真实设备上 - iOS universal app links working on simulator, not on real device Flutter iOS 应用程序在模拟器中完美运行,但在真实设备中无法运行 - Flutter iOS app working perfect in simulator but not in real device Tabbarcontroller在模拟器上工作而不在iOS设备上 - Tabbarcontroller is working in simulator not on iOS device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM