WDWClient Class Reference

Inherits from NSObject
Declared in WDWClient.h

Overview

Primary class to interact with the WDW-SDK. Use WDWBuilder to instanciate.

  delegate

delegate should implement the WDWClientDelegate protocol. * All delegate methods are executed on the provided delegateQueue

@property (weak, nonatomic) id<WDWClientDelegate> delegate

Declared In

WDWClient.h

  delegateQueue

Dispatch queue for the WDWClientDelegate callbacks execution

@property (assign, nonatomic) dispatch_queue_t delegateQueue

Discussion

By default, all delegate messages are delivered to the main dispatch queue, which helps you to manage UI update events. You can provide your own serial queue:

self.wdwClient = dispatch_queue_create("myQueue", DISPATCH_QUEUE_SERIAL);

Declared In

WDWClient.h

– startMonitoring

Starts monitoring location and motion data. If the current location is in a relevant area, the WDW-SDK provides a json string. This string can be evaluated by the server. Also, the monitoring of the location is required for the evaluation of push message.

- (void)startMonitoring

Declared In

WDWClient.h

– stopMonitoring

Stops monitoring location and motion data. The monitoring can be restarted with startMonitoring.

- (void)stopMonitoring

Declared In

WDWClient.h

– evaluatePushMesage:

Evaluates the push notification payload. Triggers the WDWClientDelegate callback if a payload is recognized as a type of WDWWarning

- (WDWWarning *)evaluatePushMesage:(NSDictionary *)payload

Parameters

payload

you’ve received in AppDelegate’s -application:didReceiveRemoteNotification.

Return Value

WDWWarning object if notification sourced from WDW service, nil otherwise

Discussion

If you’re using your own push instead of the WDW’s push service, the push message needs to be an NSDictionary using a message string as Key and a warning in form of an escaped JSON as value.

NSDictionary *wdwMessage = @{@"message" = @"Put your escaped JSON String from your backend here"};
[self.wdwClient evaluatePushMesage:wdwMessage];

Note: If your delegate implements -wdwClient:didReceiveDrivingWarning: it will be triggered on the delegateQueue as result.

Declared In

WDWClient.h

+ version

Returns the WDWSDK framework version

+ (NSString *)version

Declared In

WDWClient.h