WLBeaconManager.h 2.88 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 WLBeaconManager.h
The Beacon Manager provides functionality for iBeacons detection and serving advertisements related to the beacons that are scanned from the device.
 @copyright Warply Inc.
 */

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@class WLInboxItem;
@class WLBaseItem;



/*!
 @class WLBeaconManager
 @discussion This manager handles beacon served campaigns and detecting iBeacon devices in range.
 service.
 */
@interface WLBeaconManager : NSObject

/*!
 @property pendingItem
 @abstract The remote notification as a WLBaseItem currently stored for later use.
 */
@property (nonatomic, strong) WLBaseItem *pendingItem;

@property (strong, nonatomic) CLLocationManager *locationManager;

/*!
 @methodgroup Getting Shared Instance
 */
/*!
 @abstract Returns a shared instance of WLBeaconManager.
 */
+ (WLBeaconManager *)sharedInstance;
/*!
 @methodgroup Launching beacon manager and beacon monitoring.
 */
/*!
 @abstract Launching the Warply Beacon Manager.
 @discussion This method initialises the shared instance of WLBeaconManager and passes an array of the beacon identifiers that the manager will search for.
 @param devices An array of beacon UUID's and identifiers for the manager to monitor.
 */
- (void) startMonitorWithBeaconsArray:(NSArray*)devices;
/*!
 @abstract Shows the campaign that was received from a beacon device.
 @discussion This class method presents the campaign that is bounded with an iBeacon device after a successful retrieval of the data of the campaign.
 @param item The WLInboxItem that contains all the necessary data of the campaign to be presented.
 */
+ (void)showItem:(WLInboxItem*)item;

@end