Skip to content

DriveMotionAlertDelegate

TNDriveMotionAlertDelegate is a protocol for users to receive safety alterts through delegate methods.

Implement TNDriveMotionAlertDelegate protocol in a class

For how to configure the implementation class of TNDriveMotionAlertDelegate, please refer to Initialize the SDK. And no matter whether TNDriveDetectionMode is .auto or .manual, the application can learn the dynamics of the trip alerts through this protocol.

1
2
3
4
5
6
7
    class DriveMotionAlertDelegate: TNDriveMotionAlertDelegate {

        func onSpeedingAlert(_ event: TNDriveSpeedingAlertEvent) {

        }

    }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    @interface DriveMotionAlertDelegate () <TNDriveMotionAlertDelegate>

    ...

    @implementation

    ...

    - (void)onSpeedingAlert:(TNDriveSpeedingAlertEvent * _Nonnull)event {

    } 

Alert Events

  • TNDriveSpeedingAlertEvent: When user start speeding in a short time, DriveMotion will broadcast this alert event, which mainly includes tripId, speeding start time and start location, and current alert level.