Background Updates
Background events collecting
DataSource library supports background updates of some sensors. To enable data collecting while app is suspended setup the following:
-
Configure the
Location updates
capability for your app in Xcode:Project Settings -> App Target -> Signing & Capabilities
- Tap
+ Capability
and chooseBackground Modes
. - Select
Location updates
checkbox.
For more information please read article Handling Location Events in the Background
-
Allow background data collecting for
TNDataSourceCenter
:1
TNDataSourceCenter.sharedInstance?.dataBackgroundCollectingEnabled = true
1
TNDataSourceCenter.sharedInstance.dataBackgroundCollectingEnabled = YES;
Warning
Background updates of accelerometer, gyroscope and gravity sensors are available only if Location Background mode is enabled and configuration file contains GPS package collection. So SDK system will wake up application for location updates, an DataSource will collect all other sensor events too.