Handle events and updates

During the lifecycle of the tracking experience, there are various events/updates which happen on HyperTrack view. In order to handle these events/updates, add HTEventsDelegate extension to your view controller.

If your use-case requires a different behavior, you can use the following methods.

Methods Description
locationStatusChangedFor(action:HyperTrackAction ,isEnabled:Bool) Called when location status changes for an Action.
networkStatusChangedFor(action:HyperTrackAction, isConnected:Bool) Called when network status changes for an Action.
actionStatusChanged(forAction: HyperTrackAction, toStatus:String?) Called when status field changes for an Action. This can be one of created, assigned, started, completed, cancelled, suspended
didRefreshData(forAction: HyperTrackAction) Called when Action data is refreshed.
class MapViewController: UIViewController, HTEventsDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        ...

        // Configure events delegate in HyperTrack map
        HyperTrack.setEventsDelegate(eventDelegate: self)
    }

    func didRefreshData(forAction: HyperTrackAction) {
        // Handle Action updates here
        ...
    }

    ...
}
@interface MapViewController() <HTEventsDelegate>

...

@end

@implementation MapViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    ...

    // Configure events delegate in HyperTrack map
    [HyperTrack setEventsDelegateWithEventDelegate:self];

    ...
}

- (void) didRefreshDataForAction:(HyperTrackAction *)forAction {
    // Handle Action updates here
    ...
}

...

@end

results matching ""

    No results matching ""