Hi developers, Do we have any way to have google maps in Compose Multiplatform other then via cocoapods and making the package available in iosMain so that I can write it in kotlin code.
Cinterop wont work beacuse the GoogleMapsIOS through SPM moves the dependencies and creates a moving target problem.
Do we have any solutions?
I had the same problem for my uber replacement and this is what I found, but I haven’t tried it out yet
j
Jonathan
08/21/2025, 12:31 PM
I wrote a 2 part medium article discussing how to do this here.
👍 2
Jonathan
08/21/2025, 12:38 PM
TLDR is you want to write a common interface for interacting with the native Google Maps SDK on both iOS and Android; then you use DI to inject your iOS interface into your common KMP code so that you can access it from your shared compose UI.
Have to get your hands dirty and write a bit of Swift code but it’s really not to difficult. My article can be used has a handrail of sort; though I don’t link to the project.
đź‘€ 1
s
Soumen pal
08/25/2025, 6:02 AM
Thanks this DI approach looks good, and I thing i would need to tweak some things as needed for myself for possible use of the approach,
I had some use cases and I guess I can be done now and wouldn't need to worry about cocoapods any more