BLE App Development on iOS Explained
- by BLE Mobile Apps
When iOS 5 came into existence, Apple came up with Core Bluetooth framework which enables the developers to write BLE app that interact with the hardware gadgets or iOS device with the use of standard BLE.
Bluetooth 4.0 is also addressed as Bluetooth Low Energy (BLE) which enables the peripherals to communicate using low energy than standard Bluetooth. Another advantage is that the user doesn’t require manual pairing with the device using system settings.
If you want to start with BLE app development, you need to have the following things:-
- An iOS device with hardware support for Bluetooth 4.0.
- The iOS Simulator that supports Core Bluetooth
- A Bluetooth LE peripheral your app can talk to.
How BLE communicates?
In the BLE world, there are two types of devices
- Peripheral – Exposes data packets to read and write. This can be seen as server.
- Central – Device that establish connection with peripherals to read/write data exposed by peripherals. This can be seen as client.
Some device act as a both central and peripheral simultaneously. For instance iOS and Mac devices.
Peripheral/Central Example:
- Smart-bands such as MI-Bands is peripheral
- iPhone/iPad that connects to the band acts as a central
BLE Communication Modes
It supports two type of communication mode in BLE:-
- Advertising Mode: The peripherals transfers’ information to the available centrals all around. This mode enables the peripherals to be known by centrals, which is termed as ‘advertising’. Using GAP broadcasting simple information can be exchanged. It is regarded as one-to-many mode.
- Connected Mode: Enables a central to exchange complex data with peripherals. The GATT protocol defines the way the conversation happens in this mode. It is regarded as one-to-one mode.
In the iOS world, it describes that typically iPhone and iPad BLE app that is developed will be central, interacting with one or more peripherals to collect data that can be then processed, analyzed or stored in some meaningful way. For instance, one common device that would be used as a peripheral is a heart rate monitor, which happens to be good device to start out with as it provides more limited set of functionality and data to sift through.
Framework used in iOS for BLE
- Core Bluetooth: The Core Bluetooth framework is an element of iOS5 SDK that adds the classes needed for your Mac and iOS apps to communicate with peripheral devices that are equipped with BLE technology. This framework uses Objective C and depends heavily on delegates which are very well documented.
- GameKit Framework: GameKit offers you the ability to develop apps that enables players to interact with each other. A GKSessionobject offers the facility to search iOS device that is within proximity using Bluetooth or Wi-Fi.
- EAaccessory framework: This framework can be used to interact with paired Bluetooth devices or devices connected through wired, Apple Connector at the base of the device. This method provides notification about various Bluetooth accessories that have been discovered by the device.
- Apple MFi program: Apple MFi Program means you will have a device that is designed to be compatible with iOS devices (meaning, the manufacturer must be a member of the Apple MFi program) and the device manufacturer most provide a protocol that you must add to your applications info.plist file.
Things you might be wondering while developing BLE app on iOS?
- Is it feasible to handle multiple BLE devices simultaneously?
Yes, iOS can interact with multiple devices – reading values and updating them etc. Not necessary to have device connected to the app. - Can the BLE app work in background?
Yes, app can work. You can set up the app in such a way that it can receive data from devices to preserve battery and memory.
- Can you communicate via Bluetooth classic or it is possible only for BLE in IOS?
Yes, it is feasible to communicate via Bluetooth classic, but you would require a certification from Apple.
What kind of BLE iOS App, TOPS can develop?
- Heart rate measurement using BLE Sensors
- Temperature and Humidity measurement using BLE sensors
- Proximity based deals/Coupon app
- iBeacon based museum application
- Beacon based city tour guide app
- BLE Smart Locks and many more….
In a nutshell, above scenario is a dive-in into Bluetooth Low Energy which enables to communicate with less energy and doesn’t require to pair in the system settings. Looking to build BLE app in iOS with us? Let’s talk on how to make it the best!