MRQSDKDelegate Protocol Reference

Conforms to NSObject
Declared in MRQSDK.h

Overview

The MRQSDK requires you to implement MRQSDKDelegate. The MRQSDKDelegate allows your application to share data with MRQSDK and respond to content update events. Optionally, you can recieve errors encountered by MRQSDK.

– mrqsdkRequestData: required method

The MobileRQ SDK will call this method to request information from the app. Return a dictionary containing data that will be shared with the MobileRQ service.

- (NSDictionary *)mrqsdkRequestData:(MRQSDK *)mrq

Parameters

mrq

The calling MRQSDK object.

Return Value

A dictionary containing information for the request data.

Discussion

Example

 - (NSDictionary*) mrqsdkRequestData:(MRQSDK*)mrq {
   NSDictionary *flight = @{
     kMRQFlightDepartureTime : @"2012-07-13T13:00:00Z",
     kMRQFlightAirline : @"UA",
     kMRQFlightAirline : @"LAX",
     kMRQFlightDestination : @"ORD",
     @"ReservationNumber" : @"123456" // flight property
   };
   NSArray *flights = @[ flight ];
   NSDictionary *trip = @{ kMRQTripFlights : flights };
   NSArray *trips = @[ trip ];
   return @{
     kMRQUserTrips : trips,
     kMRQTags: @[ @"demo", @"sample app", @"show lots"],
     kMRQProperties: @{ @"favouriteColour": @"liquorice" }, // context property
   };
 }

Request Data Dictionary Keys

Request data contains data about the traveler and the trips they have planned.

Key Required Description
kMRQTags No An array of groups the device belongs to. Offers can match one or more tags.
kMRQProperties No A dictionary containing context properties.
kMRQUserTrips No An array of scheduled trips. Also see kMRQUserTrips Keys.

kMRQUserTrips Keys

A dictionary containing the itinerary for a scheduled trip.

Key Required Description
kMRQTripFlights No An array of scheduled flights. Also see kMRQTripFlights Keys.
kMRQTripHotels No An array of hotel reservations. Also see kMRQTripHotels Keys

kMRQTripFlights Keys

A dictionary containing the details for a schedule flight.

Key Required Description
kMRQFlightDepartureTime Yes The departure time in ISO8601. Example @”2012-07-13T13:00:00-7:00”
kMRQFlightAirline Yes The IATA airline code. Example @”UA”
kMRQFlightNumber Yes The IATA flight number. Example @”123”
kMRQFlightOrigin No The IATA departure airport code. Example @”LAX”
kMRQFlightDestination No The IATA arrival airport code. Example @”ORD”

Any other keys will become flight properties in the MRQ application.

kMRQTripHotels Keys

A dictionary containing the details of a hotel reservation.

Key Required Description
kMRQHotelName Yes The full name of the hotel. MobileRQ uses the hotel name to match a reservation with a property.
kMRQHotelChain No The name of the hotel chain
kMRQHotelCanceled No YES if the reservation was canceled
kMRQHotelCheckInTime No The check in time in ISO8601. Example @”2012-07-13T13:00:00-7:00”
kMRQHotelCheckOutTime No The checkout time in ISO8601. Example @”2012-07-15T13:00:00-7:00”
kMRQHotelCheckedIn No YES or No depending on whether checkin has occurred
kMRQHotelCheckedOut No YES or No depending on whether checkout has occurred
kMRQHotelLocation No The location of the property helps match the reservation with MobileRQ’s database
kMRQHotelLocationLatitude No The property latitude
kMRQHotelLocationLongitude No The property longitude
kMRQHotelLocationCity No The hotel city
kMRQHotelLocationRegion No The hotel state or province
kMRQHotelLocationCountry No The hotel country

Any other keys will become hotel properties in the MRQ application.

Declared In

MRQSDK.h

– mrqsdk:updateWithMatches: required method

Called when content matches request data.

- (void)mrqsdk:(MRQSDK *)mrq updateWithMatches:(NSInteger)matching

Parameters

mrq

The calling MRQSDK object.

matching

The number of matches.

Declared In

MRQSDK.h

– mrqsdk:didFailWithError:

Called when an error occurs while updating content

- (void)mrqsdk:(MRQSDK *)mrq didFailWithError:(NSError *)error

Parameters

mrq

The calling MRQSDK object.

error

An NSError describing the error

Declared In

MRQSDK.h