Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducción a iBeacons

Introducción a iBeacons

Presentación de la charla para el segundo meetup de MobileUY.

Juan Ignacio Laube

January 28, 2014
Tweet

Other Decks in Programming

Transcript

  1. Es una tecnología de posicionamiento.! Permite recibir notificaciones al entrar

    o salir de cierta ubicación que estamos monitoreando.! Basado en Bluetooth 4.0 (a.k.a. BLE).
  2. La tecnología por si sola no es lo importante…! Lo

    interesante está en todas sus posibles aplicaciones.
  3. UUID e Identifier identifican una región.! Major y Minor son

    dos valores numéricos que pueden ser usados por el desarrollador.
  4. Immediate < 1 m Near 1 a 2 m Far

    < 70 m Outside (unknown)
  5. http://estimote.com/ Estimote Pack de 3 x U$S 99.! Features extras

    como acelerometro y termometro.! Pila de litio, dura ~2 años.! UUID programable.! API extra para iOS y Android.
  6. http://www.radiusnetworks.com/ Radius Network RadBeacon default UUID - U$S 29.! RadBeacon

    custom UUID - U$S 39.! ! Hay packs x100 y x1000.! ! Proveen software adicional de analytics y herramientas para desarrolladores.
  7. http://www.thetileapp.com/ Tile U$S 20 cada uno.! Pila interna, no se

    puede cambiar.! Vida util de un año.! Facil de ubicar.!
  8. Raspberry Pi Necesita un modulo Bluetooth 4.0 USB.! Existen implementaciones

    de beacon advisers open source.! Costo aproximado del kit U$S 50.
  9. Publicidad.! Mejor comunicación con el usuario.! Localización en espacios reducidos.!

    Identificación de objetos personales.! Recorridos por museos.! Juegos.
  10. #import <CoreLocation/CoreLocation.h> #import "MyViewController.h" ! @interface MyViewController () <CLLocationManagerDelegate> !

    @property(nonatomic, strong) CLLocationManager *locationManager; ! @end ! ! @implementation MyViewController ! static NSString *_beaconUUIDStr = @“Beacon UUID"; static NSString *_beaconIdentifierStr = @“Beacon Identifier"; ! . . .
  11. - (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[CLLocationManager alloc] init];

    self.locationManager.delegate = self; NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:_beaconUUIDStr]; CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:_beaconIdentifierStr]; ! region.notifyOnEntry = YES; region.notifyOnExit = YES; [self.locationManager startMonitoringForRegion:region]; [self.locationManager requestStateForRegion:region]; }
  12. - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region ! - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion

    *)region ! - (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region ! - (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region
  13. #import <CoreBluetooth/CoreBluetooth.h> #import <CoreLocation/CoreLocation.h> #import "MyViewController.h" ! @interface MyViewController ()

    <UITextFieldDelegate> ! @property (strong, nonatomic) CBPeripheralManager *peripheralManager; ! @end
  14. - (void)startAdvertising { CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:_beaconUUID major:_major

    minor:_minor identifier:_identifier]; NSDictionary *beaconData = [region peripheralDataWithMeasuredPower:nil]; NSLog(@"Start advertising with data: %@", beaconData); [self.peripheralManager startAdvertising:beaconData]; self.isAdvertising = YES; }