Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CHLibrarian/1e8dd4ab3ee20885821d to your computer and use it in GitHub Desktop.
Save CHLibrarian/1e8dd4ab3ee20885821d to your computer and use it in GitHub Desktop.
ContextHub Event Services Remove Subscription (Android)
// Unsubscribe from "office-chaione" tag to stop receiving events from beacon and geofence elements for that tag
List<String> tags = new ArrayList<String>("office-chaione");
List<String> subscriptionTypes = Arrays.asList("beacon", "geofence");
SubscriptionProxy proxy = new SubscriptionProxy();
proxy.updateSubscriptions(SubscriptionOperation.REMOVE, tags, subscriptionTypes, new Callback<SubscriptionResponse>() {
@Override
public void onSuccess(SubscriptionResponse result) {
Toast.makeText(getActivity(), "Beacon and geofence subscriptions removed", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Exception e) {
Toast.makeText(getActivity(), "Error removing beacon and geofence subscriptions", Toast.LENGTH_SHORT).show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment