RPKManager Class Reference
| Inherits from | NSObject |
| Conforms to | CLLocationManagerDelegate RPKAccuracyManagerDelegate |
| Declared in | RPKManager.h |
Overview
RPKManager
This is the main class for used for interacting with the Proximity Kit SDK.
More information can be found at http://proximitykit.com
Tasks
-
+ getVersion -
+ manager -
+ managerWithDelegate: -
+ managerWithDelegate:andConfig: -
+ managerWithConfig: -
– logLevel: -
– start -
– stop -
– sync -
– syncWithCompletionHandler: -
delegateproperty -
locationManagerproperty -
locationManagerDelegateproperty -
kitproperty -
– getRegionForIdentifier: -
– startRangingBeacons -
– stopRangingIBeacons -
– setPartnerIdentifier: -
– setAirship:
Properties
delegate
delegate
@property (assign) id<RPKManagerDelegate> delegateDiscussion
delegate
Primary delegate for the RPKManager.
Declared In
RPKManager.hkit
kit
@property (readonly) RPKKit *kitDiscussion
kit
The representation of the Kit as defined in the Proximity Kit service. This contains lists of iBeacons and Geofences.
Declared In
RPKManager.hlocationManager
locationManager
@property (readonly) CLLocationManager *locationManagerDeclared In
RPKManager.hlocationManagerDelegate
locationManagerDelegate
@property (assign) id<CLLocationManagerDelegate> locationManagerDelegateDiscussion
locationManagerDelegate
Proxy for all of the CLLocationManager delgate methods. All of the non-deprecated methods from CLLocationManagerDelegate will be called on this object.
This is useful for accessing the underlying core location functionality while using the same locationManager instance that Proximity Kit wraps and maintains.
Declared In
RPKManager.hClass Methods
getVersion
getVersion
+ (NSString *)getVersionDiscussion
getVersion
Get the version string for the Proximity Kit Framework
Declared In
RPKManager.hmanagerWithConfig:
managerWithConfig
+ (RPKManager *)managerWithConfig:(NSDictionary *)configDiscussion
managerWithConfig
Creates the manager without a delegate and uses the supplied configuration dictionary instead of loading the configuration from the plist file.
Configuration Options:
- [kit](#//api/name/kit)_url: NSString with the PK [kit](#//api/name/kit) URL - api_token: PK API Token - allow_cellular_data: Allow cellular data usage - monitor_closest_beacon: Provide a callback event when the closest beacon changes - averaging_seconds: Time period (in seconds) to average accuracy measurements over (optional)
Declared In
RPKManager.hmanagerWithDelegate:
managerWithDelegate
+ (RPKManager *)managerWithDelegate:(id<RPKManagerDelegate>)delegateDeclared In
RPKManager.hmanagerWithDelegate:andConfig:
managerWithDelegate:andConfig
+ (RPKManager *)managerWithDelegate:(id<RPKManagerDelegate>)delegate andConfig:(NSDictionary *)configDiscussion
managerWithDelegate:andConfig
Creates the manager, assignes the delegate, and uses the supplied configuration dictionary instead of loading the configuration from the plist file.
Declared In
RPKManager.hInstance Methods
getRegionForIdentifier:
getRegionForIdentifier
- (RPKRegion *)getRegionForIdentifier:(NSString *)identifierDiscussion
getRegionForIdentifier
Lookup the RPKRegion for a given identifier.
Returns nil if no region found.
Declared In
RPKManager.hlogLevel:
logLevel Set the logging level. Follows syslog convention of levels 0-7.
- (void)logLevel:(NSInteger)levelDiscussion
logLevel Set the logging level. Follows syslog convention of levels 0-7.
See RPKLogger.h for more details
Param: logLevel
Can take an integer value between 0 and 7, to represent the log level.
0 - Emergency: System is unusable 1 - Alert: Action must be taken immediately 2 - Critical: Critical conditions 3 - Error: Error conditions 4 - Warning: Warning conditions 5 - Notice: Normal but significant condition 6 - Informational: Informational messages 7 - Debug: Debug-level messages
Declared In
RPKManager.hsetAirship:
setAirship
- (void)setAirship:(id)airshipDiscussion
setAirship
Sets the shared instance of Urban Airship SDK instance.
Param: airship the instance of UAirship manager
[pkManager setAirship: [UAirship shared]];
Declared In
RPKManager.hsetPartnerIdentifier:
setPartnerIdentifier
- (void)setPartnerIdentifier:(NSString *)identifierDiscussion
setPartnerIdentifier
Sets the partner identifer string for analytics.
Limited to 255 characters.
Declared In
RPKManager.hstartRangingBeacons
startRangingIBeacons
- (void)startRangingBeaconsDiscussion
startRangingIBeacons
Start calculating ranges for iBeacons.
Declared In
RPKManager.hstop
stop
- (void)stopDiscussion
stop
Unregister regions and beacons and stop automatic syncing.
While the RPKManager is stopped if sync is called the api will be called
and data downloaded and synced. However, any regions will not be
registered with CoreLocation.
Declared In
RPKManager.hstopRangingIBeacons
stopRangingIBeacons
- (void)stopRangingIBeaconsDiscussion
stopRangingIBeacons
Stop calculating ranges for iBeacons.
Declared In
RPKManager.hsync
sync
- (void)syncDiscussion
sync
Force a sync with the server. This is not normally required.
Declared In
RPKManager.hsyncWithCompletionHandler:
syncWithCompletionHandler
- (void)syncWithCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult ))completionHandlerDiscussion
syncWithCompletionHandler
Same as sync, but accepts a block for the sync callbacks. This is
particularly useful for updating the ProximityKit data when the
application in in the background.
To take advantage of this you need to implement
application:performFetchWithCompletionHandler: on your in your
application delegate. Then Within that method you can simply call
syncWithCompletionHandler and pass it the compleation block:
- (void) application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
// ...
[pkManager syncWithCompletionHandler: completionHandler];
}
Be sure to set the fetch interval in your didFinishLaunching method:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
[application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
return YES;
}
Finally make sure you add UIBackgroundModes to your info plist with a string set to ‘fetch’
Declared In
RPKManager.h