简体   繁体   中英

wake up app from background by location iOS

I have to do an app that I need accelerometer values, but in iOS app , when it goes in background I can't update this accelerometer values. For this reason,I heard about a system that app wakes from background(it doesn't go in foreground but it can execute code) by 3G/4G/LTE location and OS gives to app 4/5 seconds for execute code(in this case I can update accelerometer values).

I'm new in this situation and I ask to you for you give me an help about it.
Thank you so much for your time

It sounds like you mean the 'Significant Change' location service.

This will waken up your app when there is a significant location change, put it in the background and give you around 10 seconds to do some work. Your app can request more background time if it needs it but it sounds like you may not.

More infopmrtaion is available on the Apple Developer site, at the time of writing here:

One thing to be aware of is that this behaviour can be affected by the users settings:

Note: When a user disables the Background App Refresh setting either globally or for your app, the significant-change location service doesn't relaunch your app. Further, while Background App Refresh is off an app doesn't receive significant-change or region monitoring events even when it's in the foreground.

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