JuniperPhoton / LockedCameraCaptureExtensionDemo

A demo for LockedCameraCapture API.
10 stars 1 forks source link

Option not appearing in Camera Control #2

Open alexfoxy opened 2 weeks ago

alexfoxy commented 2 weeks ago

Heya, I'm trying to build an extension into my app, but I can't get the app to appear in the list of options for being openable by the camera control. What could I be missing?

JuniperPhoton commented 2 weeks ago

Hi. I suppose that once you have built your Capture Extension and made it work, it will appear in the list automatically and no other actions should be done.

alexfoxy commented 1 week ago

Are you selecting the extention from the build targets? i.e. from this list:

Screenshot 2024-09-30 at 13 27 02
JuniperPhoton commented 1 week ago

The target to launch has nothing to do with the issue that your app is not listed in the Camera Control settings. However, if you can select your app in the Action Button settings by the "Control" page, it should also included in the Camera Control list. If it won't, maybe you can try forcing the system to refresh: change the system language to the other one and change it back.

alexfoxy commented 1 week ago

Hmm, ok I’ll try it. I added all the extensions from Apple’s guide but I can’t get it to appear in either the widget list or the camera control list.

jaekong commented 1 day ago

Personally, I had the same issue on my app. It was because I was using Swift Package to share common logic between the main app, the widget extension and the capture extension.

The source file that has the subclass of CameraCaptureIntent has to be inside the main app target's source directory. Apple made AppIntentsPackage protocol to deal with this issue, but it doesn't work as of Xcode 16 and iOS 18.1 beta 6.

Apparently using framework, or anything similar also doesn't work - even if you added target membership (Swift Packages don't support traditional target membership so I couldn't check that.)

In my case, I just duplicated the same source code, one inside my App's target source directory, and the other inside the Swift Package (I couldn't just move it because some of the shared code inside the package depended on the Intent) and It works well. I added all the target memberships to the Intent source file on my App.

jaekong commented 1 day ago

@JuniperPhoton It would be very helpful if you can mention this problem on the README file. There's not a lot of resources on LockedCameraCapture as of now, and your project has helped me quite a lot on figuring out the problem. But also, it would be great if other people could just skip to the solution.

JuniperPhoton commented 1 day ago

@jaekong Thanks. I totally ignore the case where the subclass of CameraCaptureIntent will be discovered by the system and should be in the main bundle.

I haven't discovered the AppIntentsPackage protocol, but according to its description, it seems to resolve this kind of issue, which I may try later.

jaekong commented 22 hours ago

@JuniperPhoton It should, but sadly it seems like it doesn't work.

https://forums.developer.apple.com/forums/thread/732535