WLInboxItem.h 5.05 KB
/*
 Copyright 2010-2016 Warply Inc. All rights reserved.
 
 Redistribution and use in source and binary forms, without modification, 
 are permitted provided that the following conditions are met:
 
 1. Redistributions of source code must retain the above copyright notice, this
 list of conditions and the following disclaimer.
 
 2. Redistributions in binaryform must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided with the distribution.
 
 THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*!
 @header WLInboxItem.h
 The WLInboxItem object is used to model the information related to the offer for
 which the Remote Notification (Push) was sent.
 @copyright Warply Inc.
 */
#import <Foundation/Foundation.h>
#import "WLBaseItem.h"
#import <CoreLocation/CoreLocation.h>

/*!
 @class WLInboxItem
 @discussion This object contains the information related to the offer for
 which the Remote Notification (Push) was sent, such as: offer title and subtitle,
 offer message, offer category, expiration date etc.
 */
@interface WLInboxItem : WLBaseItem

/*!
 @property title
 @abstract An string object with the offer title.
 */
@property (nonatomic, copy) NSString *title;
/*!
 @property subtitle
 @abstract An string object with the offer subtitle.
 */
@property (nonatomic, copy) NSString *subtitle;
/*!
 @property offer_message
 @abstract An string object with the offer message.
 */
@property (nonatomic, copy) NSString *offer_message;
/*!
 @property offer_category
 @abstract An string object with the offer category.
 */
@property (nonatomic, copy) NSString *offer_category;
/*!
 @property expires
 @abstract An integer object with the offer expiration date (epoch format).
 */
@property(nonatomic) NSInteger expires;
/*!
 @property starts
 @abstract An integer object with the offer starting date (epoch format).
 */
@property(nonatomic) NSInteger starts;
/*!
 @property delivered
 @abstract An integer with the time / date the offer was delivered (epoch format).
 */
@property (nonatomic) NSInteger delivered;

@property (nonatomic) NSString *extra_fields;

/*!
 @property opened
 @abstract An integer counting the times this offer has been opened.
 */
@property (nonatomic) NSInteger opened;

/*!
 @property sorting
 @abstract An NSNumber wrapping an int indicating the suggested order of the offers from the server in descending order.
 */
@property (nonatomic) NSInteger sorting;

/*!
 @property is_new
 @abstract A a BOOL indicating whether the item is new (it is the first time it is being presented in the inbox of the user
 */
@property (nonatomic) BOOL is_new;

/*!
 @property location
 @abstract This property is a CLLocation object if the inbox item is connected to a geofencing poi and nil otherwise 
 */
@property (nonatomic) CLLocation *location;

/*!
 @property distance
 @abstract The distance from the location the getInboxItemsNearLocation:withSuccessBlock:failureBlock: call uses as a parameter or from the users current location if the getInboxItemsNearMeWithSuccessBlock:failureBlock: was used to retrieve the inbox items.
 */
@property (nonatomic) CLLocationDistance distance;

/*!
 @property radius
 @abstract The radius of the corresponding geofence.
 @discussion If the inbox item is linked to a geofencing campaign, and the users location is inside this radius, they will get a push notification.
 */
@property (nonatomic) CLLocationDistance radius;

/*!
 @property name
 @abstract The alias of the item in case it is linked to a location (location != nil).
 @see //apple_ref/occ/instp/WLInboxItem/location location
 */
@property (nonatomic) NSString *name;
/**
 *  @property display_type
    @abstract This property defines the type of the native ad.
    @discussion It can be full_page, half_page, list or feed.
 */
@property (nonatomic) NSString *display_type;
/*!
    @property campaign_type
    @abstract This property defines the type of the campaign.
    @discussion It can be standard-offer, beacon, etc.
 */
@property (nonatomic) NSString *campaign_type;

/*!
 @methodgroup Initializing a WLInboxItem Object
 */
/*!
 @abstract Initialise a WLInboxItem Object.
 @discussion Initializes and returns a newly allocated WLInboxItem object with 
 the specified WLBaseItem object.
 @param baseItem A WLBaseItem object.
 @return Returns WLInboxItem object.
 @see //apple_ref/occ/cl/WLBaseItem WLBaseItem
 */
- (id)initWithItem:(WLBaseItem *)baseItem;

@end