Sooner or later a shared Kotlin screen needs something that only one platform has yet: a purchase, a photo picker, a cloud save. The usual answer is expect/actual. I found a smaller one in my own apps: give shared code an interface, and let the property be null when the platform cannot do it. Here is how that looks in real code, and where it stops working.
The problem: a feature that exists on one side only
My Astrolings app is a Kotlin Multiplatform project with an Android app and an iOS app sharing one Compose interface. When I ported it to iOS, the Android version already sold a remove-ads purchase. The iOS version, in its first release, did not have that product defined in the store yet.
The shared screen still had to draw a profile page, and that page has a remove-ads button. So the real question was: how does shared code learn that this button should not exist on this platform?…