Initialization
API Interface / iOS
Last updated
API Interface / iOS
Last updated
Initialize the SDK shared
instance and prepare the required services based on the passed . SDK must be successfully initialized once before any of the SDK Services can be used. Call this API on the shared
instance to initialize the SDK:
Parameters
launchOptions
TheAPI must be executed beforereturns. We recommend calling it in .
Once the MOVE SDK has been successfully initialized and started for the first time, the SDK will then set up its timers, tasks, and system triggers to be able to automatically wake up in the background and start its services, even if the app has been killed by the user.
When the app wakes up in the background because of the SDK triggers and tasks, the SDK must be already initialized and started before receiving those events in order to be to handle them.
Initializing the MOVE SDK beforereturns will guarantee that all the required SDK components are initialized and ready to handle the triggered system events.
How can you make sure that the app synchronises with the MOVE backend even if you have patches of offline operation ?
For security reasons we cannot schedule background data upload tasks to upload data to the MOVE backend. Hence, the application must be running (at least) in the background. In order to guarantee that data is sent in a timely manner, we recommend setting up a BackgroundFetch-functionality in the app delegate of your host application.
Additionally: the background fetch is essential in case you only configure WALKING in your MOVE project. In this case, the background fetch is the only mechanism to wake up your app in the background and record WALKING data in the first place.
For background fetches to work in iOS12 and below you need to implement the background fetch callback of the app delegate:
and set the minimum background fetch interval for example in the app delegate's didFinishLaunchingWithOptions() with an interval of e.g. 4 hours:
[: Any]?
The launch options passed in.
Follow the guide at the The upload will start automatically as soon as the SDK switches into RUNNING state (SDK 1.6) respectively after initializing the SDK (SDK 2.x and higher).