简体   繁体   中英

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. 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. 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.

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).

Why are location services stopping in background in an iOS 9 real iPhone ?

I need help to solve this, thanks in advance.

With iOS 9 you also need to set allowsBackgroundLocationUpdates to yes . See the docs here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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