Posts

Showing posts from June, 2018

Beacons in Swift and Android

Image
In this post we will identify the key concepts needed to implement beacons in our Android and iOS apps, using the iBeacon protocol, resulting in a push notification when a user gets close to any of our beacons. Prerequisites #Swift - iOS supports the iBeacon protocol out of the box on their own SDK, so no previous installation is needed. #Android - Android requires the use of a third-party library to make it work, so we went with AltBeacon , which is pretty much the only one available. We will add it to our build.gradle with the following line: implementation ' org.altbeacon:android-beacon-library:2+ ' // If using Gradle plugin version < 3, use "compile" instead of "implementation" Setup #Swift - We will manage beacons on our AppDelegate class, so now it has to implement  CLLocationManagerDelegate. - Create a new class variable let locationManager = CLLocationManager () referencing the location manager, from the core location lib...