DEV Community

Ismoy Belizaire
Ismoy Belizaire

Posted on

ImagePickerKMP 1.0.23: Controling Camera Launch on iOS with `directCameraLaunch`

The latest release of ImagePickerKMP (v1.0.23) brings a small but
powerful addition for iOS developers: a new flag called
directCameraLaunch.

This feature gives you control over whether the image picker should
open directly into the camera or show the source selection
dialog
first.

The New Flag: directCameraLaunch

By default, the picker shows a dialog on iOS asking the user to choose
between camera and gallery.\
With directCameraLaunch, you can now change that behavior:

  • directCameraLaunch = true → Skips the dialog and opens the camera immediately.\
  • directCameraLaunch = false → Keeps the dialog so the user can choose.

Usage Example

Here's how you can use it with ImagePickerLauncher in your Compose
Multiplatform project:

    ImagePickerLauncher(
        config = ImagePickerConfig(
            onPhotoCaptured = { result ->
                capturedPhoto = result
                showCamera = false
            },
            onError = {
                showCamera = false
            },
            onDismiss = {
                showImagePicker = false // Reset state when user doesn't select anything
            },
            directCameraLaunch = false // Set to true if you want to launch the camera directly Only IOS
        )
    )

Enter fullscreen mode Exit fullscreen mode

Why This Matters

This new option provides better UX flexibility:

  • Apps that want a streamlined flow (e.g., scanning receipts, IDs, QR codes) can go straight to the camera.\
  • Apps that want to offer both gallery and camera selection can keep the dialog.

In short: you now have the best of both worlds, controlled with a simple
flag.

Dependency

To try it out, update your Gradle dependency to the latest version:

dependencies {
    implementation("io.github.ismoy:imagepickerkmp:1.0.23")
}
Enter fullscreen mode Exit fullscreen mode

Final Thoughts

The directCameraLaunch flag makes ImagePickerKMP even more versatile
for real-world use cases. Whether your app prioritizes fast camera
access or user choice, you can now support both seamlessly with version
1.0.23.


Are you planning to use directCameraLaunch in your project? Would you
prefer the dialog or direct camera launch by default?

Github: https://github.com/ismoy/ImagePickerKMP

Top comments (0)