Skip to content

Instantly share code, notes, and snippets.

@CHLibrarian
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CHLibrarian/921338791c871c67d269 to your computer and use it in GitHub Desktop.
Save CHLibrarian/921338791c871c67d269 to your computer and use it in GitHub Desktop.
ContextHub Event Services Remove Subscription Gist
// Unsubscribe to "office-chaione" tag and stop receiving events from beacon and geofence elements with that tag
NSString *tag = @"office-chaione";
if ([[CCHSensorPipeline sharedInstance] removeElementsWithTags:@[tag]]) {
NSLog(@"Successfully removed subscription to \"%@\" tag", tag);
} else {
NSLog(@"Failed to remove subscription to \"%@\" tag", tag);
}
// Remove a specific observer from your class (recommended)
[[NSNotificationCenter defaultCenter] removeObserver:self name:CCHSensorPipelineDidPostEvent object:nil];
// Remove all observers from your class
[[NSNotificationCenter defaultCenter] removeObserver:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment