Skip to content

Getting Started

Eric Internicola edited this page Jan 6, 2019 · 3 revisions

Installing GeoTrackKit

The recommended method of installing is via cocoapods:

1. Update your Podfile

Add the following line to your podfile for the Core Spec

pod 'GeoTrackKit'

Add the following line to your Podfile for the HealthKit subspec (includes Core)

pod 'GeoTrackKit', :subspecs => ['HealthKit']

Example Podfile:

platform :ios, '11.0'

target 'ExampleApp' do
  use_frameworks!

  # Pods for ExampleApp
  pod 'GeoTrackKit', :subspecs => ['HealthKit']

  target 'ExampleAppTests' do
    inherit! :search_paths
  end

end

2. Install the pods

pod install

You should see something in the output like this:

Installing GeoTrackKit 0.4.2

3. Add Location Services to your App

Update your Info.plist file to enable location services and inform the user of why you want to use location services - Note: there are 3 possible keys that you can use 1, two or all of them - NSLocationWhenInUseUsageDescription - The description for why you want to use location services for when the app is in use - NSLocationAlwaysUsageDescription - The description for why you want to use location services "Always" - NSLocationAlwaysAndWhenInUseUsageDescription - The description of why you want to use Location Services (for legacy iOS versions that don't support both a separate setting for When In Use and Always)

Example Info.plist excerpt

<key>NSLocationAlwaysUsageDescription</key>
<string>Always having access to your location allows this app to detect when you're getting too close to Mordor so that we can notify you of the danger.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Access to your location allows this app to inform your loved ones of your location on your mission too destroy the ring at Mount Doom.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Access to your location allows this app to detect when you get close to Mordor and to inform your loved ones of your location on your mission to destroy the ring at Mount Doom.</string>

4. HealthKit Info.plist updates

If you're using the HealthKit subspec, you will need to update your Info.plist with the NSHealthShareUsageDescription key to inform users why you want access to their Health data:

<key>NSHealthShareUsageDescription</key>
<string>Access to your workout data is required to import tracks from workout activities that have an associated geo track.</string>

Next:

Integration Guide

Clone this wiki locally