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
NSDictionary *userInfo = @{ @"alert":self.messageField.text}; | |
[[CCHNotificationService sharedService] sendAPNSNotificationToAliases:@[[ContextHub deviceId]] userInfo:userInfo withCompletion:^(NSError *error) { | |
NSLog(@"Error %@", error); | |
}]; |
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 didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { | |
CCHNotificationService *sharedService = [CCHNotificationService sharedService]; | |
NSString *deviceID = [ContextHub deviceId]; | |
[sharedService registerDeviceToken:deviceToken withAlias:deviceID withCompletion:^(NSError *error) { | |
if(error) { | |
NSLog(@"%@", error); | |
} else { | |
NSLog(@"Success :)"); | |
} |
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
NSDictionary *userInfo = @{ @"alert":self.messageField.text}; | |
[[CCHNotificationService sharedService] sendAPNSNotificationToDevices:@[@"longdevicetokenhere", @"anotherlongdevicetokenhere"] userInfo:userInfo withCompletion:^(NSError *error) { | |
NSLog(@"Error %@", error); | |
}]; |
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"]; | |
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound ]; | |
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
openssl pkcs12 -in Certificates.p12 -out certificate.pem -nodes -clcerts |
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]; | |
} |
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
#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 - CCHContextEventManagerDataSource | |
- (NSDictionary *)contextEventManager:(CCHContextEventManager *)eventManager payloadForEvent:(NSDictionary *)event { | |
return @{@"company":@"ChaiONE", @"project":@"ContextHub"}; | |
} |