Last active
August 29, 2015 14:10
-
-
Save CHLibrarian/41b57e8adda63d3cdc8d to your computer and use it in GitHub Desktop.
ContextHub Element Services Beacon Create (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
// Creating a beacon region with name "Beacon", tag "beacon-tag" | |
BeaconProxy proxy = new BeaconProxy(); | |
proxy.createBeacon("Beacon", "B9407F30-F5F8-466E-AFF9-25556B57FE6D", 100, 1, new String[]{"beacon-tag"}, | |
new Callback<Beacon> { | |
@Override | |
public void onSuccess(Beacon result) { | |
// If you do not have push properly set up, you need to explicitly call synchronize on ProximityService so it will generate events for this device | |
ProximityService.getInstance().synchronize(); | |
Toast.makeText(getActivity(), result.getName(), Toast.LENGTH_SHORT).show(); | |
} | |
@Override | |
public void onFailure(Exception e) { | |
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment