davidortinau/maui-skills/maui-media-picker
Claude Code and agent skill by davidortinau/maui-skills
- community
Checking that the SKILL.md file is still in the repository.
Guidance for picking photos/videos, capturing from camera, multi-select (.NET 10), MediaPickerOptions, platform permissions, and FileResult handling in .NET MAUI. USE FOR: "pick photo", "capture photo", "take picture", "pick video", "camera capture", "MediaPicker", "photo gallery", "image picker", "multi-select photos", "MediaPickerOptions". DO NOT USE FOR: general file picking (use maui-file-handling), image display or optimization (use maui-performance), or camera streaming (use maui-platform-invoke).
Install
npx vskill@latest install davidortinau/maui-skills/maui-media-pickerSKILL.md
.NET MAUI Media Picker — Gotchas & Best Practices
Common Mistakes
1. Forgetting to check for cancellation
Single-select returns null, multi-select returns an empty list. Not checking causes NullReferenceException.
2. Calling from a background thread
All MediaPicker methods must run on the UI thread or they throw.
3. Not checking IsCaptureSupported
Devices without cameras (emulators, some tablets) will throw if you call capture methods.
4. Not disposing streams
OpenReadAsync() returns a stream that must be disposed.
Platform Pitfalls
⚠️ SelectionLimit is not enforced on Android/Windows
MediaPickerOptions.SelectionLimit is advisory. Always validate the count yourself:
⚠️ Android storage permissions split at API 33
- API ≤ 32: needs
READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE - API ≥ 33: needs
READ_MEDIA_IMAGES/READ_MEDIA_VIDEO(broad storage permissions are ignored) - Use
android:maxSdkVersion="32"on the old permissions to avoid Play Store warnings
⚠️ iOS requires all four plist keys for full functionality
Missing any one of NSCameraUsageDescription, NSMicrophoneUsageDescription, NSPhotoLibraryUsageDescription, or NSPhotoLibraryAddUsageDescription causes a runtime crash when that feature is accessed.
⚠️ Android requires <queries> for camera intents
Without the IMAGE_CAPTURE query in AndroidManifest.xml, CapturePhotoAsync may fail silently on Android 11+ due to package visibility restrictions.
Decision Framework
| Scenario | Method | |
|---|---|---|
| User picks one photo | PickPhotoAsync() | |
| User picks multiple (.NET 10+) | PickPhotosAsync() with SelectionLimit | |
| App needs camera capture | Check IsCaptureSupported → CapturePhotoAsync() | |
| Save picked file permanently | Copy stream to FileSystem.AppDataDirectory | |
| Need photo metadata | Set PreserveMetaData = true in MediaPickerOptions |
Checklist
- [ ] All picker calls run on the UI thread
- [ ] Null/empty checks after every pick/capture call
- [ ]
IsCaptureSupportedguard before capture methods - [ ] Streams disposed with
using - [ ] Android manifest has both old and new storage permissions with
maxSdkVersion - [ ] Android manifest has
<queries>block for camera intent - [ ] iOS
Info.plisthas all four usage description keys - [ ]
SelectionLimitvalidated in code, not trusted from platform
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/maui-skills/skills/maui-media-picker/SKILL.md
Popularity
- Repository stars
- 107
- Repository forks
- 15
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 3 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davidortinau/maui-skills/maui-media-picker)