Basic integration

This guide will help you setup the iOS Consumer SDK in your application for live tracking. The Consumer SDK has a extensible map view and methods to track task statuses.

If you're looking for an example integration, use the example-ios application.

[warning] Requirements

The SDK is compatible with iOS 8 and above.

Install the dependency

To install the SDK, you will need CocoaPods. In your project directory, create a Podfile with the following content to add HTConsumer pod to your project. Once the Podfile is configured, install the SDK with the following command.

[warning] Xcode workspace

As with CocoaPods installations, use the .xcworkspace project file to open it in Xcode after the pods have been installed.

use_frameworks!

target 'YourApp' do
   pod 'HTConsumer'
end
$ pod install

Configure the API key

Once the pods have been installed, we can use the SDK methods inside Xcode. The first step is to configure your publishable key in the SDK.

In Objective-C, configure the SDK in application:didFinishLaunchingWithOptions: method of the AppDelegate.

In Swift, configure the SDK in application(_:didFinishLaunchingWithOptions:) method of the AppDelegate.

@import HyperTrack;

@implementation AppDelegate

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {

  [HyperTrack setPublishableAPIKey:@"YOUR_PUBLISHABLE_KEY"];
  return YES;
}

@end
import HTConsumer

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    //Initialize SDK
    HyperTrack.setPublishableAPIKey("YOUR_API_KEY")
    // Override point for customization after application launch.
    return true
}

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""