Last active
August 29, 2015 14:09
-
-
Save CHLibrarian/3c5a59e3589720915d5f to your computer and use it in GitHub Desktop.
ContextHub Event Services Add Event Subscription (Android)
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
// Subscribe to "office-chaione" tag and start receiving events from beacon and geofence elements with that tag | |
List<String> tags = Arrays.asList("office-chaione"); | |
List<String> subscriptionTypes = Arrays.asList("beacon", "geofence"); | |
SubscriptionProxy proxy = new SubscriptionProxy(); | |
proxy.updateSubscriptions(SubscriptionOperation.ADD, 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