Simple Asset Tracking Example
This example guides you through the following steps:
-
Initialization with Customized Configurations: Learn how to set up the SDK with customized configuration values, tailoring it to your specific requirements and preferences.
-
Updating Configuration Settings at Runtime: Discover how to dynamically modify configuration settings such as LocationConfig, NotificationConfig, and DataTrackingConfig during the execution of your application. This flexibility empowers you to adapt the SDK to changing conditions and user needs in real time.
For all code examples, refer to iOS Tracking Android Code Examples
UpdateConfigurationViewController view source
Upon executing the code example provided above, your app's appearance will resemble the following snippet:
Code Highlights
The above code snippet is a class inherited from the UIViewController class, which is the base class for all view controllers in iOS.
-
The class has three outlet properties: updateLocationConfigBtn, updateNotificationConfigBtn, and updateDataTrackingConfigBtn. These properties are linked to the corresponding UI elements in the view controller's storyboard.
-
The class has three methods to update the location configuration, notification configuration, and data tracking configuration, respectively. These methods call the AssetTracking.shared.updateLocationConfig(), AssetTracking.shared.updateNotificationConfig(), and AssetTracking.shared.updateDataTrackingConfig() methods, respectively.
-
The class has a createAsset() method to create a new asset.
-
The class has a bindAssetAndStartTracking() method to bind the asset to the current view controller and start tracking it.
Here is a more detailed explanation of some of the key concepts in the code:
-
AssetTracking: This is the class that is responsible for tracking assets.
-
LocationConfig: This class represents the configuration for location tracking.
-
NotificationConfig: This class represents the configuration for notification settings.
-
DataTrackingConfig: This class represents the configuration for data tracking settings.