iBeacons

iBeacon is an indoor proximity technology that enables a smartphone or other device to perform actions when it detects the iBeacon device in its range. An iBeacon is a small wireless transmitter that broadcasts data about itself over Bluetooth 4.0 LE, and every mobile device that has a Bluetooth 4.0 LE can detect it without pairing a connection with it.

With Pushwoosh you can send push notifications when a user comes close enough in the range of an iBeacon transmitter device. Unlike Geozones, which are used for setting up macro-location notifications, iBeacon is intended for micro-location targeting, such as indoor navigation at exhibitions, retail stores, stadiums, etc.

In order to utilize Pushwoosh with iBeacons, you have to set up iBeacon transmitters, or you can turn your iPhone (4s and above) or your Mac into a transmitter during tests and setup.

## iBeacon Specifications

Each iBeacon transmitter has three variables that allow to distinguish between multiple transmitters in the area:

  • UUID – The device’s Universally Unique Identifier, a 36 hexadecimal characters string. The UUID should be the same for all iBeacon devices you own and use for a given application. You should specify this unique identifier in the iBeacon page of your app in Pushwoosh Control Panel first. After that you will be able to proceed with adding transmitters.
  • Major Number – A number, which is given to a group of related transmitters. It makes sense to give the same major number to all transmitters that are used in the same location. For example, a retail chain should set different major numbers for each store.
  • Minor Number – A number that is given to each transmitter within the group, used to distinguish between iBeacons within one location. For example, each transmitter that has the same major number should have a unique minor number.

You can generate UUID and set Major and Minor Numbers for transmitters using the software provided by its manufacturer.

Enabling iBeacons for Native iOS SDK

1. Add one of the following keys to your Info.plist:

  • NSLocationAlwaysUsageDescription – if you would like your application to react to beacons while running in the background and when it’s closed;
  • NSLocationWhenInUseUsageDescription – if you would like your app to look for beacons only then it’s running in the foreground.

2. Start iBeacon tracking when needed with

[[PushNotificationManager pushManager] startBeaconTracking];
## Enabling iBeacons for Native Android SDK

1. Add Bluetooth permissions to your manifest file as follows:

**2.** Enlist following services in your manifest file:
**3.** Use the following methods of the PushManager in order to enable and disable scanning for available iBeacons in the area: ``` public void startTrackingBeaconPushes(); ``` , ``` public void stopTrackingBeaconPushes(); ```
  1. The public static void setBeaconBackgroundMode(Context context, boolean backgroundMode) method notifies the iBeacon service that the IBeaconConsumer is either moving to background mode or foreground mode. When in background mode, BluetoothLE scans to look for iBeacons are executed less frequently in order to save battery life. The specific scan rates for background and foreground operation are set by the defaults below:

Setting up iBeacons in Pushwoosh

Once you have set three variables listed above for your iBeacons, you should specify all these details in the iBeacon page of the application in your Pushwoosh Control Panel, so that Pushwoosh will be able to identify these iBeacons.

  1. Specify and save the UUID of your transmitters, it will unlock the Add Beacons button. iBeacons_guide_1
  2. Specify the location name for your reference, and the Major Number of iBeacons within this location. iBeacons_guide_2
  3. Add all your transmitters within this location with their corresponding unique Minor Numbers. iBeacons_guide_3
  4. Set messages that will be sent to devices that come in the range of Beacons. Pushwoosh treats all Beacons in the group as one entity, and sends notifications based on three types of events whenever a device detects any transmitter. These three events are as follows: 1. When a device first detects any iBeacon. For example, you can say Hello to a user coming into your store.
  5. If a device remains in the range of Beacons for a certain amount of time. For example, you can offer your assistance or a discount.
  6. When a device goes out of iBeacon range. For example, you can say Thanks for coming here, we’ll be glad to see you again upon this event.

iBeacons_guide_4

If you would like to skip triggering of any of these events, just set the radio button control to Don’t Send.

You can either send simple text in a push, or use one of your Push Presets with advanced platform settings, such as custom sound, badge number, custom data etc.

Another important thing is that you definitely don’t want to bother your users with the same recurring notifications, which might happen if a user passes by your store multiple times during a day. In order to avoid it, we recommend setting the Cooldown Period for a group of iBeacons (i.e. for the whole Major Number) to 24 hours. Thus, Pushwoosh will know that if the device has already received pushes from this group today, it will not send them to this device for the next 24 hours.

You can always fine-tune your messages and manage iBeacon transmitters within a major group by clicking on the Edit button in the list of locations you have already created.

iBeacons_guide_5