Skip to content

Workaround for app termination issue#5

Open
JuniperPhoton wants to merge 2 commits intomainfrom
feature/capture_event_terminate
Open

Workaround for app termination issue#5
JuniperPhoton wants to merge 2 commits intomainfrom
feature/capture_event_terminate

Conversation

@JuniperPhoton
Copy link
Copy Markdown
Owner

This PR demonstrates and provides a workaround for this issue:

https://developer.apple.com/forums/thread/769024#769024021

@JuniperPhoton JuniperPhoton changed the title Workaround for app termination issue WIP Workaround for app termination issue Nov 24, 2024
@JuniperPhoton JuniperPhoton force-pushed the feature/capture_event_terminate branch from 37fd620 to de6cfd7 Compare November 24, 2024 07:38
@JuniperPhoton JuniperPhoton changed the title WIP Workaround for app termination issue Workaround for app termination issue Nov 24, 2024
@qiuyukay
Copy link
Copy Markdown

hi Junipe.

Your demo and blogs on CaptureExtension have been super helpful for me developing my extension ❤️.
But, on this given issue, I didn't think the reason that the main App was terminated is that it doesn't start a capture session when launched. Actually it is because the AVCaptureEventInteraction was not added to the window.

With executing these
let view = await WidgetControlIntentDependency.shared.getAVCaptureEventInteractionHoldingView() if let vc = UIViewController.topMost, let view = view { vc.view.addSubview(view) view.frame = .init(origin: .zero, size: .zero) }
the main App would not be terminated by the system under any circumstances.

Best regards.

@JuniperPhoton
Copy link
Copy Markdown
Owner Author

Thanks for sharing. I just tested on this PR by removing the viewModel.setupTemperaryCameraSession() line which setup a temporary camera session.

Since once the AVCaptureEventInteraction is setup, it will no longer be removed. But I find that the main app will still be terminated in the following steps:

  1. Launch the main app, put it in the settings page.
  2. Go to the home screen.
  3. Press Camera Control to launch the app.
  4. Stay in the settings page, and a few seconds later, it will be terminated.

Currently I am using iOS 18.3.1, but I think Apple still doesn't fix this issue yet.

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.

2 participants