WDWMessageEvaluation Protocol Reference
| Conforms to | NSObject |
|---|---|
| Declared in | WDWMessageEvaluation.h |
Overview
Specifies the WDW-SDK messages evaluation protocol. Allows you to implement your own message evaluation routine for incoming messages.
– evaluateMessage:
required method
Implement this method for custom WDW-SDK message evaluation
- (WDWWarning *)evaluateMessage:(NSDictionary *)objectParameters
object |
Push notification object which is received in AppDelegate’s -application:didReceiveRemoteNotification: Parsing the notification objectYou need to extract the WDW event object at the key path “aps.alert.body”:
Then analyze and evaluate it accordingly to the specified data structure. Content of wdwMessage object
Content of Metadata
Content of Data
Content of Location
|
|---|
Return Value
WDWWarning object with properly recognized eventType or nil.
You should return nil if the Wrong Way Driver event dictionary passed by the object argument lacks at least one of the required fields (meta, data, location). Otherwise, you should properly calculate the eventType, a distance to it and return them as a WDWWarning instance:
if (!wdwEvent[@"meta"] || !wdwEvent[@"data"] || !wdwEvent[@"location"]) return nil;
// your evaluation code
// ...
return [[WDWWarning alloc] initWithEventType:calculatedType andDistance:calculatedDistance];
Declared In
WDWMessageEvaluation.h