Skip to content

PhotosPicker (PhotosUI) is not bridged for the Android target #106

Description

@Jeehut

Summary

SwiftUI / PhotosUI's PhotosPicker has no SkipFuseUI bridge. On iOS it is the standard cross-platform photo-library entry point; on the Android target there is no equivalent, so an app that wants a photo picker must drop to a raw-Compose #if SKIP shim around androidx.activity.compose.rememberLauncherForActivityResult + androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia.

A grep of the SkipFuseUI / SkipUI sources for PhotosPicker / PhotosUI returns nothing — confirming there is no bridge or stub.

Environment

  • skip 1.8.14
  • skip-fuse 1.0.2
  • skip-fuse-ui 1.15.0
  • skip-android-bridge 0.6.1
  • module mode: native

Why this matters

PhotosPicker is one of the few SwiftUI surfaces that is genuinely cross-platform in intent — Android has a first-class system Photo Picker (ActivityResultContracts.PickVisualMedia, available via androidx.activity 1.7+). A bridge would let PhotosPicker(selection:matching:) "just work" on both platforms the way .refreshable / .sensoryFeedback already do.

Workaround (works today)

A top-level #if SKIP struct …: ContentComposer rendered through ComposeView transpiles + runs cleanly:

#if SKIP
struct PickVisualMediaComposer: ContentComposer {
   @Composable func Compose(context: ComposeContext) {
      let launcher = androidx.activity.compose.rememberLauncherForActivityResult(
         androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia()
      ) { uri in /* read + resize via a co-located .kt helper */ }
      androidx.compose.material3.Button(onClick: {
         launcher.launch(androidx.activity.result.PickVisualMediaRequest(
            androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia.ImageOnly))
      }) { androidx.compose.material3.Text("Pick a photo") }
   }
}
#endif

Verified end-to-end on an Android emulator in a native-mode Skip Fuse app. The workaround is fine; this issue is a feature request for a first-class PhotosPicker bridge so apps do not each re-derive the shim.

Repro context

Surfaced by the SpotCrown app (Skip Fuse, iOS + Android) while building a photo-upload pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions