{"id":13658301,"url":"https://github.com/icerockdev/moko-geo","last_synced_at":"2025-08-11T07:38:12.892Z","repository":{"id":36900595,"uuid":"229683003","full_name":"icerockdev/moko-geo","owner":"icerockdev","description":"Geolocation access for mobile (android \u0026 ios) Kotlin Multiplatform development","archived":false,"fork":false,"pushed_at":"2025-03-08T17:02:32.000Z","size":251,"stargazers_count":186,"open_issues_count":11,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-08T18:18:16.038Z","etag":null,"topics":["android","ios","kotlin","kotlin-multiplatform","kotlin-multiplatform-mobile","kotlin-native","moko"],"latest_commit_sha":null,"homepage":"https://moko.icerock.dev/","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/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2019-12-23T05:30:25.000Z","updated_at":"2025-03-03T16:56:49.000Z","dependencies_parsed_at":"2024-08-02T05:04:16.260Z","dependency_job_id":"d78c7131-dcd7-476b-9925-29467ef10f84","html_url":"https://github.com/icerockdev/moko-geo","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-geo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-geo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-geo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-geo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/moko-geo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250592063,"owners_count":21455492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","ios","kotlin","kotlin-multiplatform","kotlin-multiplatform-mobile","kotlin-native","moko"],"created_at":"2024-08-02T05:00:58.462Z","updated_at":"2025-04-24T08:31:50.408Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","funding_links":[],"categories":["Multiplatform","Libraries"],"sub_categories":["Multiplatform libraries","📱 Device"],"readme":"![moko-mvvm](https://user-images.githubusercontent.com/5010169/71337878-0e0d0f80-2580-11ea-8ac5-69a132334960.png)  \n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/geo) ](https://repo1.maven.org/maven2/dev/icerock/moko/geo) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko\u0026name=geo)\n\n# Mobile Kotlin geolocation module\nThis is a Kotlin Multiplatform library that provides geolocation to common code.\n\n## Table of Contents\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Samples](#samples)\n- [Set Up Locally](#set-up-locally)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- **Geolocation tracking** - track user geolocation from common code;\n- **Compose Multiplatform** support;\n\n## Requirements\n- Gradle version 6.0+\n- Android API 16+\n- iOS version 9.0+\n\n## Installation\nroot build.gradle  \n```groovy\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\n\nproject build.gradle\n```groovy\ndependencies {\n    commonMainApi(\"dev.icerock.moko:geo:0.8.0\")\n\n    // Compose Multiplatform\n    commonMainApi(\"dev.icerock.moko:geo-compose:0.8.0\")\n}\n```\n\n## Usage\nin common code:\n```kotlin\nclass TrackerViewModel(\n    val locationTracker: LocationTracker\n) : ViewModel() {\n\n    init {\n        viewModelScope.launch {\n            locationTracker.getLocationsFlow()\n                .distinctUntilChanged()\n                .collect { println(\"new location: $it\") }\n        }\n    }\n\n    fun onStartPressed() {\n        viewModelScope.launch { locationTracker.startTracking() }\n    }\n\n    fun onStopPressed() {\n        locationTracker.stopTracking()\n    }\n}\n```\n\nIn Android:\n```kotlin\n// create ViewModel\nval locationTracker = LocationTracker(\n    permissionsController = PermissionsController(applicationContext = applicationContext)\n)\nval viewModel = TrackerViewModel(locationTracker)\n\n// bind tracker to lifecycle\nviewModel.locationTracker.bind(lifecycle, this, supportFragmentManager)\n```\n\nIn iOS:\n```swift\nlet viewModel = TrackerViewModel(\n    locationTracker: LocationTracker(\n        permissionsController: PermissionsController(),\n        accuracy: kCLLocationAccuracyBest\n    )\n)\n```\n\n## Samples\nPlease see more examples in the [sample directory](sample).\n\n## Set Up Locally \n- The [geo directory](geo) contains the `geo` library;\n- In [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps.\n\n## Contributing\nAll development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.\n\nThe `develop` branch is pushed to `master` on release.\n\nFor more details on contributing please see the [contributing guide](CONTRIBUTING.md).\n\nBefore send PR please run checks on local:\n- `./local-check.sh` in root of repository\n- `./local-check.sh` in `sample` directory\n\n## License\n        \n    Copyright 2019 IceRock MAG Inc.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-geo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmoko-geo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-geo/lists"}