Gigigo Keynote - Geofences & iBeacons

Post on 28-Jan-2015

105 views 0 download

Tags:

description

Geofences & iBeacons Keynote at Gigigo by Alejandro Rupérez - Programmer Analyst - Research & Development

Transcript of Gigigo Keynote - Geofences & iBeacons

Geofences & iBeacons

Alejandro RupérezProgrammer Analyst

(Research & Development)contact@alexruperez.com

Geofence

• A geofence is a virtual perimeter or barrier for real-world geographic areas.

• A geofence could be dynamically generated as in a radius around a point location.

Geofence

• When the location-aware device of a location-based service (LBS) user enters or exits a geofence, the device receives a generated notification.

iBeacon

• "A new class of low-powered, low-cost transmitters that can notify nearby iOS 7 devices of their presence." - Apple Inc.

iBeacon

• Works on Low Energy Bluetooth (BLE), also known as Bluetooth 4.0 or Bluetooth Smart.

• iBeacons has endless possibilities like indoor positioning systems or social media check-ins.

Example

Example

• When the user enters in the shopping center’s geofence, the application is set to hear the iBeacons with their ProximityUUID (Universally unique identifier).

Example

• We can detect and triangulate the user's position within the shopping center placing several iBeacons with the same identifier ProximityUUID and a major identifier for each store.

Example

• We can also detect and triangulate the user's position within the store placing several iBeacons with the same identifier ProximityUUID, the store’s major identifier and minor identifiers for each section.

Example

Example

• We can detect when the user approaches or moves away from a section for advertising or offers.

• We can generate a payment area where you can pay with the phone without having to put the phone close to a NFC device.

How to implement this on iOS devices?

iOS Implementation

• Add the CoreLocation.framework

• Implement the protocol CLLocationManagerDelegate.

• Create a CLLocationManager instance and set the delegate.

iOS Implementation

• CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:CLLocationCoordinate2DMake(40.44699, -3.58719) radius:150 identifier:@"Shopping Center Geofence"];

iOS Implementation

• [locationManager startMonitoringForRegion:region];

iOS Implementation

• - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region

• - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region

iOS Implementation

• CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:@"01234567-89AB-CDEF-FEDC-BA9876543210"] identifier:@"Shopping Center iBeacons"];

iOS Implementation

• [locationManager startRangingBeaconsInRegion: beaconRegion];

iOS Implementation

• - (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region

• The beacons NSArray contains detected iBeacons in CLBeacon objects.

iOS Implementation• CLBeacon Class Reference:

• proximityUUID

• major

• minor

• proximity (The relative distance to the beacon: Immediate, Near, Far or Unknown.)

• accuracy (The accuracy of the proximity value, measured in meters from the beacon.)

• rssi (The received signal strength of the beacon, measured in decibels.)

Thanks!