Last active
August 29, 2015 14:10
-
-
Save CHLibrarian/cf86a1e113d965c68bd4 to your computer and use it in GitHub Desktop.
Application Services Device Retrieve by ID (iOS)
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 *deviceToRetrieveID = @"76BC4719-6344-4E62-8FA2-F00A8D29B60E"; | |
// Retrieve device from ContextHub | |
[[CCHDevice sharedInstance] getDeviceWithId:deviceToRetrieveID completionHandler:^(NSDictionary *device, NSError *error)completionHandler { | |
if (!error) { | |
NSString *deviceID = device[@"id"]; | |
NSString *deviceType = device[@"device_type"]; | |
// Not present if not previously set | |
NSString *deviceAlias = device[@"alias"]; | |
NSArray *deviceTags = device[@"tags"]; | |
NSString *tagString = device[@"tag_string"]; | |
// Not present if push not configured | |
NSString *pushToken = device[@"push_token"]; | |
// Not always present | |
NSDictionary *lastProfile = device[@"last_profile"]; | |
NSDictionary *additional_info = device[@"additional_info"]; | |
} else { | |
NSLog(@"Error retrieving device from ContextHub); | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment