Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Simulator and Real device have different results #505

Closed
brianp opened this issue Nov 5, 2023 · 3 comments
Closed

iOS Simulator and Real device have different results #505

brianp opened this issue Nov 5, 2023 · 3 comments
Labels
await investigate The issue is waiting for further investigation.

Comments

@brianp
Copy link

brianp commented Nov 5, 2023

Describe the bug
When using requestType with RequestType.video I get different results in the iOS simulator than on a real device. In the iOS simulator, only video assets are returned. This is the correct behaviour. When the flutter app is built in release mode and used on a real iOS device (iPhone XR, OS: 16.6) all media is available to select. Filtering for video-only assets is not functioning.

How to reproduce

AssetPicker.pickAssets(context,
  pickerConfig: const AssetPickerConfig(
    maxAssets: 1,
    requestType: RequestType.video,
))

Steps to reproduce the behavior:
On a real iOS device

  1. Trigger the asset picker
  2. See that all assets are available, not filtered by asset type.

Expected behavior

  1. Trigger the asset picker
  2. See only video assets

Version information

  1. Device: iPhone XR
  2. OS: iOS 16.6

  1. Simulator iPhone XR
  2. OS: iOS 16.4

  • Package Version: 8.7.1
  • Flutter Version: 3.13.6

Additional context
Behaviour in the simulator is not the same as behaviour on real device. Validating this incorrect behaviour is not possible on the simulator, as it will provide the expected result.

@brianp brianp added the await investigate The issue is waiting for further investigation. label Nov 5, 2023
@AlexV525
Copy link
Member

AlexV525 commented Nov 5, 2023

https://github.com/fluttercandies/flutter_photo_manager?tab=readme-ov-file#filtering-only-live-photos

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2023
@brianp
Copy link
Author

brianp commented Nov 5, 2023

Cheers mate!

For anyone finding this later on. The link provided suggests the problem is that livephotos are included as "video" by default. This meant on my real device I had significantly more media displaying than expected. You need to pass an ios specific option to filter out livephotos as well.

I changed my code from the above example to the following, and got my expected result:

AssetPicker.pickAssets(context,
  pickerConfig: AssetPickerConfig(
    maxAssets: 1,
    requestType: RequestType.video,
    filterOptions: FilterOptionGroup(containsLivePhotos: false),
))

@AlexV525
Copy link
Member

AlexV525 commented Nov 5, 2023

- When `requestType` equals to `RequestType.video`,
the picker will obtain *Live Photos* on iOS by default.
You can disable it by setting `FilterOptionGroup.containsLivePhotos`
to `false`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await investigate The issue is waiting for further investigation.
Projects
None yet
Development

No branches or pull requests

2 participants