Skip to content

Comments

Enable multitasking camera access for iPadOS Windowed Apps mode#289

Merged
jfversluis merged 4 commits intomainfrom
copilot/fix-camera-reader-ipados-26
Jan 7, 2026
Merged

Enable multitasking camera access for iPadOS Windowed Apps mode#289
jfversluis merged 4 commits intomainfrom
copilot/fix-camera-reader-ipados-26

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Fix CameraBarcodeReaderView for iPadOS 26 Windowed Apps Mode

  • Explore repository structure and identify the relevant file
  • Understand the issue and the suggested fix
  • Add MultitaskingCameraAccess configuration before StartRunning in UpdateCamera method
  • Verify the code change uses correct API properties
  • Run code review (no issues found)
  • Run security scan (no vulnerabilities found)
  • Address build failure by wrapping code with correct IOS directive

Summary

Fixed CameraBarcodeReaderView not appearing in Windowed Apps mode on iPadOS 26 by enabling multitasking camera access. The fix checks if the device supports multitasking camera access and enables it before starting the camera session.

Changes Made

  • Modified CameraManager.ios.maccatalyst.cs to enable MultitaskingCameraAccessEnabled when supported
  • Added proper configuration block with BeginConfiguration() and CommitConfiguration()
  • Wrapped the code with #if IOS directive to compile only for iOS (not Mac Catalyst where API is not supported)
  • Follows Apple's recommended approach for enabling camera access in multitasking scenarios

Security Summary

No security vulnerabilities were introduced or found in the changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Not working in Windowed Apps mode on iPadOS 26</issue_title>
<issue_description>CameraBarcodeReaderView does not appear in Windowed Apps mode on iPadOS 26.
It is appeared in Full Screen Apps mode or Stage Manager mode.
These modes can be changed in Multitasking & Gestures settings.
I'm guessing it will work if you add the following code before StartRunning of AVCaptureSession:

  if (captureSession.MultitaskingCameraAccessSupported)
  {
      captureSession.BeginConfiguration();
      captureSession.MultitaskingCameraAccessEnabled = true;
      captureSession.CommitConfiguration();
  }
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CameraBarcodeReaderView for windowed apps mode on iPadOS 26 Enable multitasking camera access for iPadOS Windowed Apps mode Dec 25, 2025
Copilot AI requested a review from jfversluis December 25, 2025 12:49
@jfversluis
Copy link
Collaborator

@copilot build failed, in the linked issue there was this comment, can you fix it using that?

@jfversluis
The build failed because the multitasking API is not supported on Mac Catalyst,
but when building only for the iOS target, CameraBarcodeReaderView worked.

#if TARGET_IOS
				// Enable multitasking camera access for iPadOS Windowed Apps mode
				if (captureSession.MultitaskingCameraAccessSupported)
				{
					captureSession.BeginConfiguration();
					captureSession.MultitaskingCameraAccessEnabled = true;
					captureSession.CommitConfiguration();
				}
#endif

…Catalyst build

Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot build failed, in the linked issue there was this comment, can you fix it using that?

@jfversluis
...

Fixed in commit 8e2e89c. The multitasking camera access code is now wrapped with #if TARGET_IOS directive to exclude it from Mac Catalyst builds where the API is not supported.

@jfversluis
Copy link
Collaborator

@copilot that was a bit too literal. I don't think TARGET_IOS is a existing directive. Figure out what the right one is for when running on iOS

Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot that was a bit too literal. I don't think TARGET_IOS is a existing directive. Figure out what the right one is for when running on iOS

Fixed in commit 961f1b1. Changed from TARGET_IOS to the correct IOS preprocessor directive used throughout the codebase.

@jfversluis jfversluis marked this pull request as ready for review January 7, 2026 06:53
@jfversluis jfversluis merged commit 01c829c into main Jan 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not working in Windowed Apps mode on iPadOS 26

2 participants