Skip to content

A framework library working as a mock version of Bespot SDK

Notifications You must be signed in to change notification settings

bespot/assessment-sdk-ios

Repository files navigation

Bespot Assessment iOS SDK

BTAssessmentSDK offers indoor location tracking and analytics reporting to 3rd party apps using BLE technology and Machine Learning.

Bespot Assessment SDK App Screenshot

Features

  • Indoor location (in/out)
  • Indoor area detection
  • Outdoor location
  • Analytics

Requirements

  • iOS 13.0+
  • Xcode 12

Installation

CocoaPods

You can use CocoaPods to install BTAssessmentSDK. See steps below:

  1. Add BTAssessmentSDK dependency to your Podfile - using git link and tag(version). See sample code hereby:
# Minimum supported iOS platform for BTAssessmentSDK
platform :ios, '10.0'
target '[Your app]' do
  # Needed for the project to use frameworks
  user_frameworks!

  # BTAssessmentSDK framework
  pod 'BTAssessmentSDK', :git => 'https://github.com/bespot/assessment-sdk-ios', :tag => '1.0.3'

  # Other Cocoapods libraries/frameworks you may use...

end
  1. Run pod update for the Cocoapods to download the BTAssessmentSDK dependency.
  2. Run pod install

Usage example

Initialization

Do the framework import:

  import BTAssessmentSDK

in your application's AppDelegate application(_:didFinishLaunchingWithOptions:) method add this line to init/configure the BTAssessmentSDK singleton object:

BTAssessmentSDK.shared.configure(applicationId: "your_app_id", applicationSecret: "your_app_secret")

Use the BTInOutDelegate delegate to receive InOut updates

In your view controller's viewDidLoad() method add this:

BTAssessmentSDK.shared.inOutDelegate = self

Extend your view controller to implement delegate method:

extension YourViewController: BTInOutDelegate {

    func didUpdateResult(status: BTStatus) {
        // TODO: Use In-Out status
    }

    func didFailUpdate(error: BTError) {
      // TODO: Inspect possible errors  
    }
}

Use the BTConfigurationDelegate delegate to check your credentials

In your view controller's viewDidLoad() method add this:

BTAssessmentSDK.shared.configurationDelegate = self

Extend your view controller to implement delegate method:

extension YourViewController: BTConfigurationDelegate {

  func didConfigure(success: Bool) {
    // TODO: Use success status
   }

  func didFailConfigure(error: BTConfigurationError) {
    // TODO: Inspect possible errors
   }
}

Subscribe for InOut status updates

In order for the solution (mock) to start provide your with location updates (inside or outside) regarding you location in relation to the store, you have to use this:

BTAssessmentSDK.shared.subscribe()

Unsubscribe from updates

To unsubscribe from updates just use this:

BTAssessmentSDK.shared.unsubscribe()

About

A framework library working as a mock version of Bespot SDK

Resources

Stars

Watchers

Forks

Packages

No packages published