Skip to content

feat(kmp-demo): add shared multiplatform Location Flow demo - #1038

Open
dkhawk wants to merge 2 commits into
feat/experimental-kmp-modulefrom
feat/kmp-location-flow-demo
Open

dkhawk wants to merge 2 commits into
feat/experimental-kmp-modulefrom
feat/kmp-location-flow-demo

Conversation

@dkhawk

@dkhawk dkhawk commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a shared Location Flow demo (LocationFlowDemo) to :maps-compose-multiplatform-demo exercising the multiplatform Location, LocationSource, and LocationPriority APIs from googlemaps/android-maps-utils#1817 across Android and iOS:

  • Dependency Wiring (gradle/libs.versions.toml, maps-compose-multiplatform/build.gradle.kts, settings.gradle.kts):
    • Adds maps-utils-kmp-core (com.google.maps.android:android-maps-utils-core) and exposes it via api(libs.maps.utils.kmp.core) in :maps-compose-multiplatform commonMain.
    • Scopes mavenLocal() in settings.gradle.kts (when useMavenLocal=true) to includeGroup("com.google.maps.android") so local KMP snapshot testing does not conflict with external dependencies.
  • Platform Location & Permission Controller (PlatformLocationSource.kt, PlatformLocationSource.android.kt, PlatformLocationSource.ios.kt):
    • Implements rememberPlatformLocationController() backed by LocationManager on Android and CLLocationManager.asLocationSource() on iOS, tracking runtime location permission state and providing permission request / system settings actions.
  • Shared LocationFlowDemo (DemoApp.kt, Demos.kt):
    • Collects LocationSource.locationEvents() in commonMain to animate the camera, update a live Marker, render a horizontal accuracy Circle, and draw a breadcrumb Polyline trail, with interactive High Accuracy / Balanced priority switching and runtime permission recovery controls.
  • App Manifests & Xcode Project Generation (maps-app/src/main/AndroidManifest.xml, iosApp/iosApp/Info.plist, iosApp/create_project.rb):
    • Declares ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION in maps-app and NSLocationWhenInUseUsageDescription in iosApp.
    • Updates iosApp/create_project.rb to check IOS_MAPS_API_KEY in secrets.properties before falling back to MAPS_API_KEY.

Note: Depends on googlemaps/android-maps-utils#1817 being merged and published to 6.1.0-SNAPSHOT for CI resolution.

Testing

  • Verified live on physical Android device (Pixel 6) and physical iOS device (iPhone 14) as well as iOS Simulator.

@dkhawk
dkhawk requested a review from kikoso October 9, 2026 23:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant