SDK Integrations

SDK Integrations

In this article, we outline how to integrate Locally’s Engage SDK into:

  • Android Applications
  • iOS Applications

The Locally EngageSDK is the code that allows your app to interact with Locally’s mobile location insight & marketing integration platform.

Android Applications

Requirements

 

Installation

 

Open your build.gradle (module: app) and add the following to your dependencies {}:
//library
implementation 'io.locally:engage-core:1.2.0'
//Android 9 or above
implementation 'commons-logging:commons-logging:1.1.1'
//Locations
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
//Beacons
implementation 'com.kontaktio:sdk:4.0.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//Images
implementation 'com.squareup.picasso:picasso:2.71828'
//Notifications
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.6.8'
implementation 'com.amazonaws:aws-android-sdk-sns:2.2.11'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
Enable the multiplex at your defaultConfig{}
    defaultConfig {
        ....
        multiDexEnabled true
        ...

iOS Applications

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Xcode 10.1+
  • Swift 4.2+

Installation

 

CocoaPods

The Locally EngageSDK for iOS is installed using CocoaPods, a dependency management platform used to install, update and delete libraries associated with a project.

Install CocoaPods using the following terminal command (click here for CocoaPods Installation Troubleshooting):

$ sudo gem install cocoapods

Still in terminal, navigate to your project directory and run the following command to initialize CocoaPods:

$ cocoapods init

Initializing CocoaPods creates a .podfile configuration file on the root of your project which CocoaPods uses to declare project dependencies.

Add the EngageSDK as a Dependency to your Project

Add the following to the .podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target 'Your Target Name' do
pod 'EngageSDK'
end
Install the EngageSDK as a Dependency

In terminal, on the root directory of the project where the .podfile was created, run the following command:

$ pod install
Permissions and Capabilities

Because the EngageSDK requires location and bluetooth permissions, add the following keys to your App list:

  • NSBluetoothPeripheralUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription
  • NSLocationWhenInUseUsageDescription

Also ensure the following permissions are selected on for your app:

  • Location Updates
  • Uses Bluetooth LE accessory
  • Act as Bluetooth LE accessory
  • Remote notifications

Usage

To learn how to use our SDK once it’s installed, check out our articles on: