WDWClientDelegate

Objective-C

@protocol WDWClientDelegate <NSObject>

Swift

protocol WDWClientDelegate : NSObjectProtocol

Delegate protocol to interact with the WDW-SDK. Delegate methods are only called when WDW-SDK monitoring is started.

After the -[WDWClient startMonitoring] is called, the following delegate methods are called at arbitrary time intervals:

Other delegate methods are executed in the following order:

  1. -wdwClient:didEnterMonitoredArea:
  2. -wdwClient:didReceiveNewData: (multiple times)
  3. -wdwClient:didLeftMonitoredArea:
  • At this point your App might want to establish a connection to the server. Called prior to the -wdwClient:didReceiveNewData: callback

    Declaration

    Objective-C

    - (void)wdwClient:(WDWClient *)client didEnterMonitoredArea:(NSString *)areaId;

    Swift

    optional func wdwClient(_ client: WDWClient!, didEnterMonitoredArea areaId: String!)
  • At this point your App might want to disconnect from the server. The -wdwClient:didReceiveNewData: will no longer be called.

    Declaration

    Objective-C

    - (void)wdwClient:(WDWClient *)client didLeftMonitoredArea:(NSString *)areaId;

    Swift

    optional func wdwClient(_ client: WDWClient!, didLeftMonitoredArea areaId: String!)
  • Used for handling errors. See SDK Error handling topic.

    Declaration

    Objective-C

    - (void)wdwClient:(WDWClient *)client didReceiveError:(NSError *)error;

    Swift

    func wdwClient(_ client: WDWClient!, didReceiveError error: (any Error)!)
  • The json data string is ready to be sent to the server. Do not modify the data. This method is called repeatedly after the -wdwClient:didEnterMonitoredArea: callback has been triggered.

    Declaration

    Objective-C

    - (void)wdwClient:(WDWClient *)client didReceiveNewData:(NSString *)json;

    Swift

    func wdwClient(_ client: WDWClient!, didReceiveNewData json: String!)
  • Called when an incoming push message is recognized as a relevant driving warning for the current user

    Declaration

    Objective-C

    - (void)wdwClient:(WDWClient *)client
        didReceiveDrivingWarning:(WDWWarning *)warning;

    Swift

    func wdwClient(_ client: WDWClient!, didReceiveDriving warning: WDWWarning!)