Detect when main app launched by LockedCameraCapture for permission

I have a LockedCameraCapture extension working well, however there is one situation I cannot find a solution to. If the user has not yet provided camera access permission then the main app will be launched rather than the LockedCameraCapture extension. I cannot find a mechanism by which my main app can detect that this was the reason for the launch and thereby request permission.

When the button is pressed from the control center without permission the app is run and the CameraCaptureIntent is called so I can prompt the user from there. However, as best I can tell the CameraCaptureIntent is not called when launched from a locked Lock Screen, the app is simply opened.

My app has a variety of functions, most of which do not involve the camera so I cannot just always prompt the user for camera access on open. Is there any mechanism by which my main app can detect it was launched for this reason so it could ask for permission? Thank you!

Thank you for flagging this issue. We are investigating internally. Stay tuned!

If you filed a Feedback on the issue, feel free to post the number here.

I am facing the same issue, when no permission is provided by the user for the app, accessing the lock screen camera capture, just opens the app. Not even the perform function in the camera capture intent is called.

This issue is being actively investigated by the engineering team. We've included it in Xcode's release notes:

https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes

This should be resolved in the current iOS 18.1 betas. Please reach out on the forums or via Feedbacks if you see any issues. Thank you for flagging everything you're seeing!

Detect when main app launched by LockedCameraCapture for permission
 
 
Q