{"id":43491167,"url":"https://github.com/livotovlabs/anchor","last_synced_at":"2026-02-03T10:04:15.489Z","repository":{"id":328220322,"uuid":"1114690897","full_name":"LivotovLabs/anchor","owner":"LivotovLabs","description":"Anchor is a native, Kotlin-first background geolocation library for Kotlin Multiplatform, designed for high performance and seamless integration in modern Android and iOS applications.","archived":false,"fork":false,"pushed_at":"2026-02-02T17:40:49.000Z","size":1221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-03T03:19:14.507Z","etag":null,"topics":["android-library","geolocation","geolocation-tracking","ios","kmp","kmp-library","kotlin-multiplatform","kotlin-multiplatform-library","location","location-services","location-tracker"],"latest_commit_sha":null,"homepage":"https://anchorkmp.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LivotovLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-11T18:36:36.000Z","updated_at":"2026-02-02T17:42:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/LivotovLabs/anchor","commit_stats":null,"previous_names":["livotovlabs/anchor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LivotovLabs/anchor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivotovLabs%2Fanchor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivotovLabs%2Fanchor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivotovLabs%2Fanchor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivotovLabs%2Fanchor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LivotovLabs","download_url":"https://codeload.github.com/LivotovLabs/anchor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivotovLabs%2Fanchor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29040794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T09:57:37.951Z","status":"ssl_error","status_checked_at":"2026-02-03T09:55:14.920Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","geolocation","geolocation-tracking","ios","kmp","kmp-library","kotlin-multiplatform","kotlin-multiplatform-library","location","location-services","location-tracker"],"created_at":"2026-02-03T10:03:56.737Z","updated_at":"2026-02-03T10:04:15.480Z","avatar_url":"https://github.com/LivotovLabs.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e⚓️ Anchor\u003c/h1\u003e\n  \u003ch3\u003eBackground Geolocation for Kotlin Multiplatform\u003c/h3\u003e\n  \n  \u003cp\u003e\n    \u003cb\u003eReliable. Battery-Conscious. Native Performance.\u003c/b\u003e\n  \u003c/p\u003e\n\n  [![Maven Central](https://img.shields.io/maven-central/v/io.anchorkmp/core?style=flat-square\u0026color=blue)](https://central.sonatype.com/artifact/io.anchorkmp/core)\n  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)\n  [![Platform](https://img.shields.io/badge/platform-android%20|%20ios-lightgrey?style=flat-square)](https://anchorkmp.io)\n  [![Status](https://img.shields.io/badge/status-alpha-orange?style=flat-square)](https://github.com/LivotovLabs/anchor)\n\n  \u003cbr/\u003e\n  \n  \u003ca href=\"https://anchorkmp.io\"\u003e\u003cstrong\u003eWebsite\u003c/strong\u003e\u003c/a\u003e · \n  \u003ca href=\"#-installation\"\u003e\u003cstrong\u003eInstallation\u003c/strong\u003e\u003c/a\u003e · \n  \u003ca href=\"#-demo-application\"\u003e\u003cstrong\u003eDemo App\u003c/strong\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003e **Anchor** is a native, Kotlin-first background geolocation library for **Kotlin Multiplatform**, designed for high performance and seamless integration in modern Android and iOS applications.\n\u003e\n\u003e ⚠️ **Note:** The product is currently in its final stages of development and testing. The official **v1.0 release** is expected during **February 2026**.\n\n---\n\n## ✨ Features\n\n- 🔋 **Always Background:** Architected specifically for reliable, long-running background tracking.\n- 🎯 **Platform Tuned:** Granular control over Android Priority/Interval and iOS Accuracy/Activity Type.\n- 🚀 **Modern API:** Built with Kotlin DSL, Coroutines, and Flow.\n- 📱 **Cross-Platform:** Single shared API for Android and iOS.\n\n---\n\n## 📦 Installation\n\nAdd the dependency to your `commonMain` source set in `build.gradle.kts`:\n\n```kotlin\ncommonMain.dependencies {\n    implementation(\"io.anchorkmp:core:0.0.1\")\n}\n```\n\n---\n\n## 🛠 Platform Setup\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e🤖 Android Setup\u003c/strong\u003e\u003c/summary\u003e\n\nNo manual initialization code is required. However, you must declare the foreground service type in your manifest if you are targeting Android 14+.\n\nThe library automatically includes the following permissions:\n- `ACCESS_COARSE_LOCATION`\n- `ACCESS_FINE_LOCATION`\n- `ACCESS_BACKGROUND_LOCATION`\n- `FOREGROUND_SERVICE_LOCATION`\n- `POST_NOTIFICATIONS`\n- `ACTIVITY_RECOGNITION`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e🍎 iOS Setup\u003c/strong\u003e\u003c/summary\u003e\n\nAdd the following keys to your `Info.plist` (typically in `iosApp/iosApp/Info.plist`):\n\n```xml\n\u003c!-- Location Permissions --\u003e\n\u003ckey\u003eNSLocationWhenInUseUsageDescription\u003c/key\u003e\n\u003cstring\u003eWe need your location to track your journey.\u003c/string\u003e\n\u003ckey\u003eNSLocationAlwaysAndWhenInUseUsageDescription\u003c/key\u003e\n\u003cstring\u003eWe need your location to track your journey even in the background.\u003c/string\u003e\n\u003ckey\u003eNSLocationAlwaysUsageDescription\u003c/key\u003e\n\u003cstring\u003eWe need your location to track your journey even in the background.\u003c/string\u003e\n\n\u003c!-- Motion Permission (for Activity Recognition) --\u003e\n\u003ckey\u003eNSMotionUsageDescription\u003c/key\u003e\n\u003cstring\u003eWe need access to motion data to detect if you are walking, running, or driving.\u003c/string\u003e\n\n\u003c!-- Background Modes --\u003e\n\u003ckey\u003eUIBackgroundModes\u003c/key\u003e\n\u003carray\u003e\n    \u003cstring\u003elocation\u003c/string\u003e\n    \u003cstring\u003efetch\u003c/string\u003e\n    \u003cstring\u003eprocessing\u003c/string\u003e\n\u003c/array\u003e\n```\n\u003c/details\u003e\n\n---\n\n## 🚀 Quick Start\n\n### 1. Configuration\n\nInitialize Anchor in your application startup logic.\n\n```kotlin\nimport io.anchorkmp.core.*\nimport kotlin.time.Duration.Companion.seconds\n\nval config = AnchorConfig.build {\n    // Shared Options\n    trackActivity = true            // Enable activity recognition (walking, driving, etc.)\n    minUpdateDistanceMeters = 10.0  // Minimum distance before an update is triggered\n\n    // Android Specifics\n    android {\n        updateInterval = 10.seconds          // Desired frequency of updates\n        priority = AndroidPriority.BALANCED  // Balance between battery and accuracy\n        \n        notification {\n            title = \"Tracking Active\"        // Persistent notification title\n            body = \"Location tracking is on\" // Persistent notification body\n            iconName = \"ic_tracker\"          // Drawable resource name\n        }\n    }\n    \n    // iOS Specifics\n    ios {\n        desiredAccuracy = IosAccuracy.BEST   // kCLLocationAccuracyBest\n        autoPause = true                     // Allow system to pause updates to save battery\n        activityType = IosActivityType.OTHER // CLActivityType\n        displayBackgroundLocationIndicator = true // Show blue pill in status bar\n    }\n}\n\nAnchor.init(config)\n```\n\n### 2. Permissions \u0026 Tracking\n\nAnchor provides a simple coroutine-based API for permission management.\n\n```kotlin\nscope.launch {\n    // 1. Request permissions (suspends until user decides)\n    // Suggest asking for Notifications \u0026 Motion first\n    Anchor.requestPermission(PermissionScope.NOTIFICATIONS)\n    Anchor.requestPermission(PermissionScope.MOTION)\n\n    // 2. Request Background Location\n    val status = Anchor.requestPermission(PermissionScope.BACKGROUND)\n    \n    if (status == PermissionStatus.GRANTED) {\n        // 3. Start Tracking\n        Anchor.startTracking()\n    } else {\n        println(\"Permission denied\")\n    }\n}\n```\n\n### 3. Observe Updates\n\n```kotlin\nscope.launch {\n    Anchor.locationFlow.collect { location -\u003e\n        println(\"📍 Location: ${location.latitude}, ${location.longitude}\")\n        println(\"🏃 Activity: ${location.activity}\")\n    }\n}\n```\n\n---\n\n## 📱 Demo Application\n\nCheck out the `sample/` directory for a complete Compose Multiplatform app demonstrating background tracking and native maps.\n\n### Running on Android\n1. Create `local.properties` in the project root.\n2. Add your Google Maps API Key: `MAPS_API_KEY=AIzaSy...`\n3. Run: `./gradlew :sample:composeApp:installDebug`\n\n### Running on iOS\n1. Open `sample/iosApp/iosApp.xcodeproj` in Xcode.\n2. Select your target device and run. (Uses native Apple Maps, no key required).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    Licensed under \u003ca href=\"LICENSE\"\u003eApache 2.0\u003c/a\u003e.\n    \u003cbr/\u003e\n    Built with ❤️ by \u003ca href=\"https://github.com/LivotovLabs\"\u003eLivotov Labs\u003c/a\u003e.\n  \u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivotovlabs%2Fanchor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivotovlabs%2Fanchor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivotovlabs%2Fanchor/lists"}