Inherits from VMRequestManager : NSObject
Declared in VMOfferManager.h
VMOfferManager.m

Overview

VMOfferManager is a subclass of VMRequestManager providing all ‘offer’ related information available to a consumer.

Tasks

Class Methods

sharedInstance

Returns the shared offer manager object for the system.

+ (instancetype)sharedInstance

Return Value

The systemwide offer manager.

Declared In

VMOfferManager.h

Instance Methods

categoriesOfferWithUserToken:includeConsumerExcludedCategories:completionBlock:failBlock:

Gets the full list of main / top-level categories, boolean parameter specifies whether or not to include categories which the current consumer has actively disabled.

- (VMHTTPRequestOperation *)categoriesOfferWithUserToken:(NSString *)token includeConsumerExcludedCategories:(BOOL)includeConsumerExcludedCategories completionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

token

Access token.

includeConsumerExcludedCategories

Parameter specifies whether or not to include categories which the current consumer has actively disabled.

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMOfferManager.h

merchantListWithUserToken:categoryId:offset:limit:completionBlock:failBlock:

Gets a list of merchants who have active offers, optionally filtered by a category id.

- (VMHTTPRequestOperation *)merchantListWithUserToken:(NSString *)token categoryId:(NSString *)categoryId offset:(NSString *)offset limit:(NSString *)limit completionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

token

Access token.

categoryId

Category ID.

offset

Offset.

limit

Limit.

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMOfferManager.h

nearbyOffersWithUserToken:latitude:longitude:categoryId:offset:limit:fields:completionBlock:failBlock:

Offers are returned in the order of those that have the closest venue come first, the details and distance (in meters) to the closest venue are also returned.

- (VMHTTPRequestOperation *)nearbyOffersWithUserToken:(NSString *)token latitude:(NSString *)lat longitude:(NSString *)lon categoryId:(NSString *)categoryId offset:(NSString *)offset limit:(NSString *)limit fields:(NSString *)fields completionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

token

Access token.

lat

Latitude.

lon

Longitude.

categoryId

Category ID. CategoryId is an optional filter that can be supplied, pass an empty or nil value to search all categories.

offset

Offset.

limit

Limit.

fields

Specify exact field names as a comma separated list in the fields parameter to restrict the population of fields with data.

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMOfferManager.h

searchOffersWithUserToken:rankedSearch:keyword:categoryId:merchantId:fields:orderBy:ascending:completionBlock:failBlock:

Offers are returned by one of 2 formats, either ‘Ranked Offers’ which have been ranked by a special criteria, e.g. ‘Hot Deals’ OR queried by category, merchant and/or keyword.

- (VMHTTPRequestOperation *)searchOffersWithUserToken:(NSString *)token rankedSearch:(BOOL)ranked keyword:(NSString *)keyword categoryId:(NSString *)categoryId merchantId:(NSString *)merchantId fields:(NSString *)fields orderBy:(NSString *)orderBy ascending:(BOOL)ascending completionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

token

Access token.

ranked

Ranked.

keyword

Keyword.

categoryId

Category ID. CategoryId is an optional filter that can be supplied, pass an empty or nil value to search all categories.

merchantId

merchantId

fields

Specify exact field names as a comma separated list in the fields parameter to restrict the population of fields with data.

orderBy

OrderBy is case-sensitive and defaults to kVMOrderByWeighting, other options are kVMOrderByLastUpdatedAt and kVMOrderByStartDate

ascending

Order direction options are YES for Ascending and NO for Descending.

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Return Value

A new request operation.

Declared In

VMOfferManager.h

termsAndConditionsWithUserToken:offerId:completionBlock:failBlock:

Gets the terms and conditions for a given offer id.

- (VMHTTPRequestOperation *)termsAndConditionsWithUserToken:(NSString *)token offerId:(NSString *)offerId completionBlock:(ObjectBlock)completionBlock failBlock:(ErrorBlock)errorBlock

Parameters

token

Access token.

offerId

Offer Id

completionBlock

The block to be executed on the completion of a successful request. This block has no return value and takes one argument: the object constructed from the response data of the request.

errorBlock

The block to be executed on the completion of an unsuccessful request. This block has no return value and takes one argument: the error that occurred during the request.

Declared In

VMOfferManager.h