Last active
August 29, 2015 14:10
-
-
Save CHLibrarian/1876275ccb198d441293 to your computer and use it in GitHub Desktop.
ContextHub Element Services Subscription Add (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
// Subscribing to a tag | |
// We want to subscribe to tags "my-tag- 1" and "my-tag-2" to be notified when beacons, geofences, or vault records with that tag are created, updated, or deleted | |
SubscriptionProxy proxy = new SubscriptionProxy(); | |
List<String> tagList = Arrays.asList("my-tag-1", "my-tag-2"); | |
List<String> subscriptionTypes = Arrays.asList("beacon", "geofence", "vault"); | |
proxy.updateSubscriptions(SubscriptionOperation.ADD, tagList, subscriptionTypes, new Callback<SubscriptionResponse>() { | |
@Override | |
public void onSuccess(SubscriptionResponse result) { | |
Toast.makeText(getActivity(), ("Beacon, geofence, and vault subscriptions added", Toast.LENGTH_SHORT).show(); | |
} | |
@Override | |
public void onFailure(Exception e) { | |
Toast.makeText(getActivity(), ("Error adding 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