What you will learn

You will learn to generate a beacon notification

Prerequisites - What you need to get started

  • A Gitlab Account: the SDK is available through a private Gitlab. You should have received an email with your user account, including a link to create a password
  • Your SDK user information: in order to initialize the Mobile SDK, you must have received a User Name, a Password and a Company Key
  • A BLE beacon: a BLE beacon configured on your account is mandatory to test the application
  • An iOS Device: you need a compatible Bluetooth Low Energy iOS device that is able to detect beacons
  • The Xcode application: you must have downloaded Xcode from the App store
  • You must have completed the 5 minutes QuickStart Tutorial.

Step 1: Clone the beacon-tutorial repository

  • Clone the beacon-tutorial repository
git clone https://github.com/Connecthings/sdk-tutorial.git

objectivec

  • Open the **iOs>ObjectiveC>Beacon>1-60seconds-to-get-beacon-notification> ** folder from the cloned sdk-tutorial folder

SWIFT

  • Open the iOs>SWIFT>Beacon>1-60seconds-to-get-beacon-notification folder from the cloned sdk-tutorial folder

Step 2: initialize the SDK

  • Open the class AppDelegate.m
  • Configure the initAdtagInstanceWithUrlType with the received informations from Connecthings:
[self initAdtagInstanceWithUrlType:ATUrlTypePreprod
                              userLogin:@"YOUR_USER"
                              userPassword:@"API_KEY"
                              userCompany:@"YOUR_COMPANY_KEY"
                              beaconUuid:@"beaconUuid"];

Warning:

We suppose that you've already configured the SDK with the 5 minutes QuickStart Tutorial.

Step 3: Get the first notification

  • Turn off the beacon
  • In Xcode, click on "Play" to launch the installation process on your phone
  • Put the application in background mode
  • Turn on the beacon
  • Once the beacon is activated, your notification message should appear
  • The displayed notification message is setup in Adtag platform

You can learn more about configuring your own BeaconNotificationListener reading the creating beacon notification tutorial