Geotracking 0.1.5

Geotracking 0.1.5

License Custom
ReleasedLast Release Jan 2018

Maintained by Tiendeo.



 
Depends on:
Alamofire~> 4.5
AWSKinesis~> 2.6.2
AWSCognito~> 2.6.2
ReachabilitySwift>= 0
Governor~> 0.1.2
 

  • By
  • Tiendeo

Tiendeo Geotracking SDK for iOS

Tiendeo Geotracking SDK for iOS is a framework for user location tracking.

Requirements

  • iOS 9.0+

Add SDK to project

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Tiendeo Geotracking into your Xcode using CocoaPods, specify it in you Podfile:

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Geotracking', '~> 0.0.8'
end

Then, run the following command:

$ pod install

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate Tiendeo Geotracking into your project manually as a Embedded Framework.

Integrate SDK in your app

In your app Capabilities switch on Background Modes and check Location updates option.
In your app .plist add the keys:

  • Privacy - Location When In Use Usage Description
  • Privacy - Location Always Usage Description
  • Privacy - Location Always and When In Use Usage Description (for iOS 11)

Usage

Add the following code in your didFinishLaunchingWithOptions method:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    Geotracking.sharedInstance.startIfNeededWithApplication(application, launchOptions: launchOptions)
    return true
}

To start the Geotracking engine, add the following line to your code:

Geotracking.sharedInstance.start(userId: userId)

where userId is an stable unique ID for the user.

Before start tracking the user will be prompted for location permissions the first time start method is called.
Set GeotrackingDelegate and implement geotrackingDidFail(with error: NSError) method if want to manage possible errors.

Check correctness

To check if everything is running, you can check if the console had an output like this:

Geotracking :: location saved

Advertisement

This framework links iOS AdSupport.framework to obtain advertisingIdentifier.