What you will learn

You will learn:

  • to configure your Podfile with our Gitlab and our SDK
  • to configure the SDK in your application

Prerequisites - What you need to start

  • The Gitlab Account: The SDK is available through a private Gitlab. You must have received an email with an user account including a link to create a password.
  • The SDK user information: You must have received a Login, a Password and a Company that permits to initialize the SDK
  • A beacon: A beacon configured on your account is mandatory to test the application.
  • An iOS Device: An iOS device compatible Bluetooth Low Energy to be able to detect the beacons
  • The Xcode: Xcode should be downloaded from the App store

Step 1: Configure the access to our Gitlab

  • Generate your SSH KEY. You can check the how to Generate SSH tutorial
  • Connect to the Connecthing Gitlab server
  • Click on profile settings at the left of the page and it will populate to box automatically.
  • Click on SSH keys at the top of the page ADD SSH KEY as described in the picture bellow

Step 2: Configure the access to our Gitlab from CocoaPods

  • Install CocoaPods $gem install cocoapods
  • Create a Podfile. This can be done by running $touch Podfile and add your dependencies
  - pod "ATConnectionHttp",:git => Gitlab path, :tag => "The latest Tag"
  - pod "ATAnalytics",:git =>  Gitlab path, :tag => "The latest Tag"
  - pod "ATLocationBeacon",:git =>  Gitlab path, :tag => "The latest Tag"
  - pod "ATQR",:git =>  Gitlab path, :tag => "The latest Tag"
  - pod "ATSdkAdtagContent",:git =>  Gitlab path, :tag => "The latest Tag"

Here is an example of validate Podfile (QrScannerDemo sample)

platform:ios, '7.0'

pod 'ATQR', :git => "https://forge.adtag.eu/ConnecthingsSDK/ATQR.git", :tag => "2.5.8"

pod 'ATSdkAdtagContent', :git => "https://forge.adtag.eu/ConnecthingsSDK/ATSdkAdtagContent.git", :tag => "2.5.8"

pod "ATConnectionHttp",:git => "https://forge.adtag.eu/ConnecthingsSDK/ATConnectionHttp.git", :tag => "2.5.8"

pod "ATAnalytics",:git => "https://forge.adtag.eu/ConnecthingsSDK/ATAnalytics.git", :tag => "2.5.8"

xcodeproj 'QrScannerDemo.xcodeproj'

Check out the Cocoapods site for more information

  • Run $pod install in your project directory.
  • Open App.xcworkspace that was created. This should be the file you use everyday to create your app.

Note:

You should add libqlite3 Frameworks into your app project.

Step 3: Clone the beacon-tutorial repository

  • Clone the beacon-tutorial repository
git clone https://github.com/Connecthings/sdk-tutorial.git
  • Open the iOs>qrCode>QrScannerDemo folder from the cloned sdk-tutorial folder

Step 4: Launch our sample into Xcode

  • Launch Xcode
  • In the root of the sample repository, check if a Podfile already exist
  • Check that your iOS SDK is up to date.
    • Open Podfile make sure that all SDK Tags are up to date
    • Run $pod install in your project directory
  • Open App.xcworkspace that was created if it didn't exist already. This should be the file you use everyday to create your app.
  • Click in your "target projet">"build settings". Make sure that Allow Non-modular includes in Frameworks Modules is set to yes as describe in the picture bellow.

  • Open the QrScannerDemo.xcworkspace project.
  • Open the class AppDelegate.m.
  • Configure the The SDK user information with the received informations from Connecthings:
user = [ATUser initInstance:@"LOGIN" Pass:@"PASSWORD" Compagny:@"COMPANY"];
  • Choose your production platform to deploy the application: in this example we choose the PRE_PROD platform

root = [ATUrlRoot initInstance: ATUrlTypePreprod];  

Note: The AdtagInitializer permits to configure the access to the various Adtag platforms.

Connecthings gives you access to three platforms :

  • The Demo platform is ideal for the technical Proof of Concept (POC) phase
  • The Pre-production platform is ideal for the beta versions
  • The Production platform is used when you're ready to publish your application

Warning 1:

Be sure to use the good access key login / password with the appropriate platform.

For each platform (Demo/Pre-production/Production) you have received a specific access key.

Warning 2:

Connecthings sent you a user to connect to the Adtag Platform and a user with an API KEY to be used with the SDK. Be sure to use the user with the API KEY to connect the SDK to the Adtag Platform, otherwise the application won't detect the beacons.

Warning 3:

Connecthings sent you two different access keys for each platform:

  • An access key to sign in the Adtag Platfrom
  • An access key to use with the mobile SDK, called API_KEY. Be sure to use the correct API KEY (login, password, and platform) to connect the SDK to the Adtag Platform, otherwise the application won't detect the beacons.
  • Connect your iOS Device to your computer
  • Into Xcode, click on "Play" to launch the installation on your phone
  • Flash the QR Code received from Connecthings
  • A new page is opening (called ResultController) displaying the name of the point associated to the QR Code