This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation QTSomeClient | |
+ (QTSomeClient *)sharedClient { | |
static QTSomeClient *_sharedClient = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_sharedClient = [QTSomeClient new]; | |
}); | |
return _sharedClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)currentDateString { | |
NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
[df setDateFormat:@"d"]; | |
NSString *day = [df stringFromDate:self.currentDate]; | |
return day; | |
} | |
- (NSString *)currentMonthString { | |
NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
[df setDateFormat:@"MMMM"]; | |
NSString *day = [df stringFromDate:self.currentDate]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Device.tag('sand_creek').where("created_at < ?", Date.today ).each { |d| d.destroy } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (event, vault, push) { | |
var vault_id = event.payload.vault.vault_info.id; | |
var data=vault.find(vault_id); | |
data.office = event.data.fence.id; | |
vault.update(vault_id, data) | |
push.sendToTags(1, [event.data.fence.id], "office_employee_changed", false ); | |
true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform :ios, '7.0' | |
pod 'ContextHub', :git => 'https://github.com/contexthub/contexthub-ios-sdk', :branch=>'master' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
//Register your app | |
[ContextHub registerWithAppId:@"823b8648-YOUR-UUID-a653-748d4fff9128"]; | |
return YES; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - CCHContextEventManagerDataSource | |
- (NSDictionary *)contextEventManager:(CCHContextEventManager *)eventManager payloadForEvent:(NSDictionary *)event { | |
return @{@"company":@"ChaiONE", @"project":@"ContextHub"}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - CCHContextEventManagerDelegate | |
- (void)contextEventManager:(CCHContextEventManager *)eventManager willPostEvent:(NSDictionary *)event { | |
NSLog(@"WILL Post Event %@", event); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - CCHContextEventManagerDelegate | |
- (void)contextEventManager:(CCHContextEventManager *)eventManager didPostEvent:(NSDictionary *)event { | |
NSLog(@"DID Post Event %@", event); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { | |
[ContextHub application:application didReceiveRemoteNotification:userInfo completion:completionHandler]; | |
} |