Skip to content

Background Updates

Background events collecting

DataSource library supports background updates of some sensors. To enable data collecting while app is suspended setup the following:

  1. Configure the Location updates capability for your app in Xcode:

    • Project Settings -> App Target -> Signing & Capabilities
    • Tap + Capability and choose Background Modes.
    • Select Location updates checkbox.

    For more information please read article Handling Location Events in the Background

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