Skip to main content
Batching API functions are used to start or stop location batching sessions. Invoke the batching APIs after invoking CapabilitiesCb, which is registered with the LocationClient constructor.

startRoutineBatchingSession

Starts a routine mode batching session with specified parameters.
  • If this API is called when idle, or after any other previous position/batching/geofence session is stopped, it delivers one of the following results:
    • If batchingCallback is nullptr, this call is a no-op.
    • If both minInterval and tripDistance do not take effect, this call is a no-op. Otherwise a batching session is started with the specified parameters and callbacks.
  • If this API is called when any previous position/batching/geofence session hasn’t yet received responseCallback, then this API receives an error code of LOCATION_RESPONSE_REQUEST_ALREADY_IN_PROGRESS via its responseCallback.
  • If this API is called during an ongoing session after the responseCallback has been received for the ongoing session, the parameters/callback will be updated, and the session continues but with a new set of parameters/callback.
  • Locations are reported on the batchingCallback in batches when the batch is full.
Syntax
Parameters Response Returns true if a batching session is successfully started. Returns false if a batching session isn’t started, that is, when batchingCallback is nullptr.

stopBatchingSession

Stops the ongoing batching session and deregisters the callbacks of a previous batching session. No callback is issued regarding the processing status. Syntax
Parameters None Response None