Skip to content

Commit e5a98f3

Browse files
committed
Update to ContextHub v1.2.0 framework
1 parent 4943b9a commit e5a98f3

File tree

7 files changed

+149
-9
lines changed

7 files changed

+149
-9
lines changed

Boundaries/Boundaries-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleExecutable</key>
1010
<string>${EXECUTABLE_NAME}</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>com.chaione.boundaries</string>
12+
<string>com.contexthub.boundaries</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
230 KB
Binary file not shown.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//
2+
// CCHDevice.h
3+
// ContextHub
4+
//
5+
// Created by Kevin Lee on 7/24/14.
6+
// Copyright (c) 2014 ChaiOne. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <UIKit/UIKit.h>
11+
12+
#define kDeviceErrorDomain @"com.contexthub.device.error"
13+
/**
14+
ContextHub Device error codes.
15+
*/
16+
typedef NS_ENUM(NSInteger, CCHDeviceErrorCode) {
17+
/**
18+
Device id cannot be nil
19+
*/
20+
CCHInvalidDeviceIdParameter,
21+
/**
22+
Alias cannot be nil
23+
*/
24+
CCHInvalidDeviceAliasParameter,
25+
/**
26+
Tags cannot be nil
27+
*/
28+
CCHInvalidDeviceTagsParameter
29+
};
30+
31+
/**
32+
The CCHDevice class is used work with devices.
33+
34+
Structure of device NSDictionary
35+
36+
| key | value |
37+
| --------- | --------- |
38+
| additional_info | NSDicationary of device specific information (not always present) |
39+
| alias | alias that is set for the device (not always present) |
40+
| device_type | describes the device, often pulled for the user agent |
41+
| id | database id for the device |
42+
| last_profile | NSDictionary of contextual information from the last time the device was seen by the server |
43+
| push_token | push token assigned to the device (not always present) |
44+
| tag_string | a comma separated string of the tags associated with the device |
45+
| tags | NSArray of tags associated with the geofence |
46+
*/
47+
@interface CCHDevice : NSObject
48+
49+
/**
50+
@return The singleton instance of CCHDevice.
51+
*/
52+
+ (instancetype)sharedInstance;
53+
54+
/**
55+
@return The vendor device id as UUIDString.
56+
*/
57+
- (NSString *)deviceId;
58+
59+
/**
60+
Registers the device with ContextHub. This method gathers meta-data about the device and sends it to ContextHub.
61+
@param completionHandler (optional) Called when the request completes. If an error occurs, the NSError will be passed to the block.
62+
@note this method can be called multiple times.
63+
*/
64+
- (void)registerDeviceWithCompletionHandler:(void(^)(NSError *error))completionHandler;
65+
66+
67+
/**
68+
Gets a device from ContextHub using the device Id.
69+
70+
@param deviceId The id of the device stored in ContextHub.
71+
@param completionHandler Called when the request completes. The block is passed an NSDictionary object that represents the device. If an error occurs, the NSError wil be passed to the block.
72+
*/
73+
- (void)getDeviceWithId:(NSString *)deviceId completionHandler:(void(^)(NSDictionary *device, NSError *error))completionHandler;
74+
75+
/**
76+
Gets devices from ContextHub using the device alias.
77+
78+
@param alias The alias associated with the devices that you are interested in.
79+
@param completionHandler Called when the request completes. The block is passed an NSArray of NSDictionary objects that represent the devices. If an error occurs, the NSError wil be passed to the block.
80+
*/
81+
- (void)getDevicesWithAlias:(NSString *)alias completionHandler:(void(^)(NSArray *devices, NSError *error))completionHandler;
82+
83+
/**
84+
Gets devices from ContextHub using tags.
85+
86+
@param tags Tags of the devices that you are interested in.
87+
@param completionHandler Called when the request completes. The block is passed an NSArray of NSDictionary objects that represent the devices. If an error occurs, the NSError wil be passed to the block.
88+
*/
89+
- (void)getDevicesWithTags:(NSArray *)tags completionHandler:(void(^)(NSArray *devices, NSError *error))completionHandler;
90+
91+
92+
/**
93+
Updates the device record on contexthub.
94+
@param alias (optional) The alias associated with the device.
95+
@param tags (optional) The tags to be applied to the device.
96+
@param completionHandler Called when the request completes. The block is passed an NSDictionary object that represents the device. If an error occurs, the NSError wil be passed to the block.
97+
@note This method updates the data for the current device. The tags and alias that are set here can be used with CCHPush. The tags can also be used with the CCHSubscriptionService. This method gathers meta-data about the device and sends it to ContextHub along with the alias and tags. You can call this method multiple times.
98+
*/
99+
- (void)updateDeviceWithAlias:(NSString *)alias tags:(NSArray *)tags completionHandler:(void(^)(NSDictionary *device, NSError *error))completionHandler;
100+
101+
@end

ContextHub.framework/Versions/A/Headers/CCHSensorPipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ extern NSString * const CCHUntaggedElements;
143143
@param completionHandler (optional) Called when the event is created. If an error occurs, the NSError wil be passed to the block.
144144
@note The event must contain a name key. If you want to pass contextual information along with the event, you can do so by setting a data key for the event.
145145
*/
146-
- (void)triggerEvent:(NSDictionary *)event completionHandeler:(void(^)(NSError *error))completionHandler;
146+
- (void)triggerEvent:(NSDictionary *)event completionHandler:(void(^)(NSError *error))completionHandler;
147147

148148
/**
149149
Calling synchronize will tell the SDK to check for server-side context changes and will update monitored regions.

ContextHub.framework/Versions/A/Headers/CCHSubscriptionService.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ extern NSString * const CCHVaultItemUpdatedNotification;
6868
*/
6969
extern NSString * const CCHVaultItemDeletedNotification;
7070

71+
/**
72+
Posted to tagged device subscribers when a corresponding tagged device is created.
73+
*/
74+
extern NSString * const CCHDeviceCreatedNotification;
75+
76+
/**
77+
Posted to tagged device subscribers when a corresponding tagged device is updated.
78+
*/
79+
extern NSString * const CCHDeviceUpdatedNotification;
80+
81+
/**
82+
Posted to tagged device subscribers when a corresponding tagged device is deleted.
83+
*/
84+
extern NSString * const CCHDeviceDeletedNotification;
85+
7186
/**
7287
Beacon option for adding and removing subscriptions.
7388
*/
@@ -83,6 +98,11 @@ extern NSString * const CCHOptionGeofence;
8398
*/
8499
extern NSString * const CCHOptionVault;
85100

101+
/**
102+
Device option for adding and removing subscriptions.
103+
*/
104+
extern NSString * const CCHOptionDevice;
105+
86106

87107
#define kSubscriptionErrorDomain @"com.contexthub.subscription"
88108

@@ -121,6 +141,15 @@ When server changes are made, the device is notified using a background push not
121141
### CCHVaultItemDeletedNotification
122142
the notification object is an id of the vualt item that was deleted. The userInfo object is not set.
123143
144+
### CCHDeviceCreatedNotification
145+
the notification object is an NSDictionary representation of the device that was created. The userInfo object is not set.
146+
147+
### CCHDeviceUpdatedNotification
148+
the notification object is an NSDictionary of representation of the device that was updated. The userInfo object is not set.
149+
150+
### CCHDeviceDeletedNotification
151+
the notification object is an id of the device that was deleted. The userInfo object is not set.
152+
124153
*/
125154
@interface CCHSubscriptionService : NSObject
126155

@@ -132,9 +161,9 @@ When server changes are made, the device is notified using a background push not
132161
/**
133162
Gets all subscriptions for the current device.
134163
@note Access individual subscriptions using "BeaconSubscription" and "GeofenceSubscription" keys
135-
@param completion executed when the request completes. The block is passed an NSDictionary of subscriptions. If an error occurs, the NSError will be passed to the block.
164+
@param completionHandler executed when the request completes. The block is passed an NSDictionary of subscriptions. If an error occurs, the NSError will be passed to the block.
136165
*/
137-
- (void)getSubscriptionsWithCompletion:(void(^)(NSDictionary *subscriptions, NSError *error))completion;
166+
- (void)getSubscriptionsWithCompletionHandler:(void(^)(NSDictionary *subscriptions, NSError *error))completionHandler;
138167

139168
/**
140169
Subscribes the device to beacon change notifications for the specified tags.
@@ -168,15 +197,15 @@ When server changes are made, the device is notified using a background push not
168197
Subscribes the device to change notifications for the specified tags.
169198
@note This will turn on background push notifications for all elements that have tags matching the tags array specified. You must enable push notifications, enbale remote notifications and background fetch capabilites, and you must call application:didReceiveRemoteNotification:completionHandler: on CCHPush.
170199
@param tags An NSArray of tags
171-
@param options (optional) an NSArray of the elements that you want to subscribe to. (CCHOptionBeacon, CCHOptionGeofence, CCHOptionVault)
200+
@param options (optional) an NSArray of the elements that you want to subscribe to. (CCHOptionBeacon, CCHOptionGeofence, CCHOptionVault, CCHOptionDevice)
172201
@param completionHandler (optional) Is executed when the request completes. If an error occurs, the NSError will be passed to the block.
173202
*/
174203
- (void)addSubscriptionsForTags:(NSArray *)tags options:(NSArray *)options completionHandler:(void(^)(NSError *error))completionHandler;
175204

176205
/**
177206
Unsubscribes the device from change notifications for the specified tags.
178207
@param tags An NSArray of tags
179-
@param options (optional) an NSArray of the elements that you want to unsubscribe from. (CCHOptionBeacon, CCHOptionGeofence, CCHOptionVault)
208+
@param options (optional) an NSArray of the elements that you want to unsubscribe from. (CCHOptionBeacon, CCHOptionGeofence, CCHOptionVault, CCHOptionDevice)
180209
@param completionHandler (optional) Is executed when the request completes. If an error occurs, the NSError will be passed to the block.
181210
*/
182211
- (void)removeSubscriptionsForTags:(NSArray *)tags options:(NSArray *)options completionHandler:(void(^)(NSError *error))completionHandler;

ContextHub.framework/Versions/A/Headers/ContextHub.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by Travis Fischer on 9/18/13.
66
// Copyright (c) 2013 ChaiOne. All rights reserved.
77
//
8+
// Version 1.2.0
9+
//
810

911
#import <Foundation/Foundation.h>
1012

@@ -20,7 +22,7 @@
2022
//Application Services
2123
#import "CCHPush.h"
2224
#import "CCHVault.h"
23-
25+
#import "CCHDevice.h"
2426

2527
/**
2628
* The primary interface with the ContextHub SDK
@@ -53,4 +55,9 @@
5355
If you are using Push Notifications, set this value to YES for debug builds. This will tell ContextHub that the push token for the device should be used with the Sandbox push service.
5456
*/
5557
@property (nonatomic, assign) BOOL debug;
58+
59+
/**
60+
build version
61+
*/
62+
extern NSString * const CCHVersion;
5663
@end

release_notes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
Boundaries (Geofences) Release Notes
2-
---
1+
# Boundaries (Geofences) Release Notes
2+
3+
## 1.3.2 (Build 172) - August 17, 2014
4+
- Update to ContextHub v1.2.0 framework
5+
- Add Table of Contents to README
36

47
## 1.3.1 (Build 171) - August 11, 2014
58
- Fix bug where app would alert an error when updating or deleting geofences

0 commit comments

Comments
 (0)