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

Cant pick more than 10 images from gallery at once iOS MAUI #126

Open
ajay-mundi opened this issue Feb 29, 2024 · 5 comments
Open

Cant pick more than 10 images from gallery at once iOS MAUI #126

ajay-mundi opened this issue Feb 29, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ajay-mundi
Copy link

ajay-mundi commented Feb 29, 2024

Description

I have some users that want to be able to select a lot of photos at once (up to 200). But they are only able to select a maximum of 10. This issue only presents on iOS

Actual Behavior

Can only select 10 photos with a selection limit of 200.

Expected behavior

Should be able to select up to the number in the selection limit

Steps to reproduce the behavior

  1. Set selection limit to a number greater than 10
  2. Try to select that many from gallery
  3. Limited at 10

Screenshots or Videos

Reproduction Link

Configuration

  • Device:
  • OS Version: iOS
  • Plugin Version:
  • Framework: MAUI
@ajay-mundi ajay-mundi added the bug Something isn't working label Feb 29, 2024
@ajay-mundi ajay-mundi changed the title Cant pick more than 10images from Gallery at Once iOS MAUI Cant pick more than 10 images from gallery at once iOS MAUI Feb 29, 2024
@beeradmoore
Copy link
Collaborator

Hey @ajay-mundi , would you be able to show a sample of how you are using the picker so I can dump that into a new MAUI project and compare and see if I have the same result?

@ajay-mundi
Copy link
Author

Hi @beeradmoore, thanks for the quick response. You can probably just use this method in the code behind of the mainpage attached to the default button in the default maui project.

public async void ChoosePhotoFromGallery()
    {
        var cts = new CancellationTokenSource();
        IMediaFile[] files = null;
        galleryItems = new List<GalleryItem>();

        try
        {
            var request = new MediaPickRequest(200, MediaFileType.Image, MediaFileType.Video)
            {
                PresentationSourceBounds = System.Drawing.Rectangle.Empty,
                UseCreateChooser = true,
                Title = "Select",
                
            };

            cts.CancelAfter(TimeSpan.FromMinutes(5));

            var results = await MediaGallery.PickAsync(request, cts.Token);
            files = results?.Files?.ToArray();
        }
        catch (OperationCanceledException oxe)
        {
            // handling a cancellation request

        }
        catch (Exception ex)
        {
            // handling other exceptions

        }
        finally
        {
            cts.Dispose();
        }
}

@beeradmoore
Copy link
Collaborator

Thanks for the code. I dumped that in the OnCounterClicked, added async, removed the galleryItems = new List<GalleryItem>(); line, and installed Xamarin.MediaGallery v2.2.1 but I was not able to replicate on iOS simulator or physical device (iOS 17.3.1).

I didn't do any of the optional stuff from the main readme here.

Does this work for you or are you getting the same behaviour as above?
MediaGalleryTest1.zip

@ajay-mundi
Copy link
Author

With a simulator I am able to get it to work with over 10 photos but with a physical device (gen 9 ipad 17.3.1) on selection of the 10th photo I am no longer allowed to select any. The selection area becomes grayed out.

@dimonovdd
Copy link
Owner

The library does not make any restrictions, all restrictions are at the iOS level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants