LocalSDK

iOS SDK

Native iOS SDK for Swift and Objective-C applications.

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/localsdk/localsdk-ios.git", from: "2.0.0")
]

CocoaPods

pod 'LocalSDK', '~> 2.0'

Quick Start

import LocalSDK

let sdk = LocalSDK(apiKey: "your_api_key")

sdk.startTracking(mode: .adaptive)

sdk.onLocation { update in
    print("Location: \(update.latitude), \(update.longitude)")
}

Requirements

  • iOS 15.0+
  • Xcode 15+
  • Swift 5.9+

Permissions

Add these keys to your Info.plist:

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription (for background tracking)

Background Tracking

Enable background location updates in your project capabilities, then configure the SDK:

sdk.startTracking(mode: .adaptive, background: true)

On this page