shadox
shadox

Reputation: 1003

iOS8 CoreMotion get updates from startActivityUpdatesToQueue when the app is suspended

The handler block is executed on a best effort basis and updates are not delivered while your app is suspended.

the Doc says that the handler block will not be delivered when the app is suspended.But what I want to do is to get user motion activity background and give user a local notification at some time.Any other solutions or which background mode should help?

Upvotes: 0

Views: 568

Answers (1)

Yogesh Maheshwari
Yogesh Maheshwari

Reputation: 1323

You can use location updates background mode to keep your application alive in background.

  • Add NSLocationAlwaysUsageDescription in your plist file.
  • In Capabilities enable Background Modes and inside that enable Location Updates
  • Add a location manager and always keep it running

NOTE: This can get your app rejected by apple so make sure you also have some use of location updates in your app.

Upvotes: 1

Related Questions