Skip to content

[image_picker ] Update pickVideo from gallery to use PHPickerViewController to avoid requested additional permissions for iOS 14+ #146400

@fingerart

Description

@fingerart

What package does this bug report belong to?

image_picker

What target platforms are you seeing this bug on?

iOS

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
  image_picker:
    dependency: "direct main"
    description:
      name: image_picker
      sha256: "26222b01a0c9a2c8fe02fc90b8208bd3325da5ed1f4a2acabf75939031ac0bdd"
      url: "https://pub.dev"
    source: hosted
    version: "1.0.7"
  image_picker_ios:
    dependency: transitive
    description:
      name: image_picker_ios
      sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3
      url: "https://pub.dev"
    source: hosted
    version: "0.8.9+1"

Steps to reproduce

I have consulted the documentation of UIImagePickerController and PHPickerViewController, and I can pull up the album selector without any permission. May I ask why pickVideo uses checkCameraAuthorizationWithImagePicker and checkPhotoAuthorizationWithImagePicker to request permissions by default?

  1. https://discussionschinese.apple.com/thread/253834114?answerId=257189479322#257189479322
  2. https://developer.apple.com/documentation/photokit/selecting_photos_and_videos_in_ios

https://github.com/flutter/packages/blob/0eead7cb335048092721c59d89936a985176b20d/packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerPlugin.m#L268-L275

Expected results

No need to request additional permissions from the user.

Actual results

Additional permissions requested.

Code sample

Code sample
ImagePicker().pickVideo(
  source: source,
  maxDuration: const Duration(seconds: 3600),
);

Screenshots or Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions