Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CHLibrarian/872f303ba35b44f57356 to your computer and use it in GitHub Desktop.
Save CHLibrarian/872f303ba35b44f57356 to your computer and use it in GitHub Desktop.
ContextHub Element Services Subscription Remove (Android)
// Unsubscribing from tag "my-tag-2"
// We want to unsubscribe from tag "my-tag-2", so we specify the REMOVE operation and the tag to remove.
SubscriptionProxy proxy = new SubscriptionProxy();
List<String> tagList = Arrays.asList("my-tag-2");
List<String> subscriptionTypes = Arrays.asList("beacon", "geofence", "vault");
proxy.updateSubscriptions(SubscriptionOperation.REMOVE, tagList, subscriptionTypes, new Callback<SubscriptionResponse>() {
@Override
public void onSuccess(SubscriptionResponse result) {
Toast.makeText(getActivity(), ("Beacon, geofence, and vault subscriptions removed", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Exception e) {
Toast.makeText(getActivity(), ("Error removing beacon, geofence, and vault subscriptions", Toast.LENGTH_SHORT).show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment