Asset Tracking Callback

This section will help users understand and utilize asset-tracking callbacks effectively. By following these steps and implementing the AssetTrackingCallback interface, you can receive valuable updates about location changes, handle errors gracefully, and keep track of when the tracking process starts and stops for a specific asset. Additionally, you have the flexibility to remove the callback when it's no longer required.

Add the Callback

To add a callback, follow these simple steps:

  • Implement the AssetTrackingCallback interface in your code.

    1
    class YourClass : AssetTrackingCallback {
    2
    // Implement callback methods here
    3
    }
  • Add the callback to the AssetTracking instance.

    1
    assetTrackingAddCallback(this)

Remove the Callback

When you no longer need the callback, you can easily remove it:

1
assetTrackingRemoveCallback(this)

Here's an overview of the available callback methods:

  • onLocationSuccess(location: Location): This method is invoked when new location information becomes available.

  • onLocationFailure(exception: Exception): If an error occurs during the tracking process, this method is called to handle the error.

  • onTrackingStart(assetId: String): It is invoked when the tracking process starts for a specified asset, providing you with relevant information.

  • onTrackingStop(assetId: String): When the tracking process stops for a particular asset, this method is triggered.

  • onTrackingStop(assetId: String, trackingDisableType: TrackingDisableType): In situations where tracking is stopped for an asset with specific disabled type information, this method provides those details.

By following these steps and understanding the available callback methods, you can effectively incorporate asset-tracking capabilities into your application without needing to be a developer.

© 2024 NextBillion.ai all rights reserved.