Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. public ShowroomManager : BeaconManager.IServiceReadyCallback {
  2. private BeaconManager beaconManager;
  3. private string scanId;
  4.  
  5. public ShowroomManager(Context context) {
  6. beaconManager = new BeaconManager(context);
  7. beaconManager.Eddystone += BeaconManager_Eddystone;
  8. }
  9.  
  10. public void StartUpdates() {
  11. beaconManager.Connect(this); // throws "callback cannot be null" exception
  12. }
  13.  
  14. public void StopUpdates() {
  15. beaconManager.StopEddyStoneScanning(scanId);
  16. }
  17.  
  18. private void BeaconManager_Eddystone(object sender, BeaconManager.EddystoneEventArgs e) {
  19. // ...
  20. }
  21.  
  22. // Implementation of IServiceReadyCallback interface:
  23.  
  24. public void OnServiceReady() {
  25. scanId = beaconManager.StartEddystoneScanning();
  26. }
  27.  
  28. public IntPtr Handle { get; }
  29.  
  30. public void Dispose() {
  31. // throw new NotImplementedException();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement