Hey folks :wave: (me again :sweat_smile: ) We managed to pack our project into a macos app. However,...
p
Hey folks 👋 (me again 😅 ) We managed to pack our project into a macos app. However, when I open it, the camera is blank. We have the permissions set up in the
Info.plist
. However, I think we need to request the permission as described here. Do we have a way to talk to native APIs? I guess one alternative would be to use Kotlin/Native and integrate that with JNI. Does any one know of a guide for this? I can only find it from Mobile 🙈
1
m
If you can make a composable that wraps the underlying Objective-C API that'd be great!
p
So, after a long week, we figured out that the app needs to be signed 🙈 Once it's signed, it works as expected. I'm working on a library to provide camera usage for Compose. I'll include details on how to sign it once it's out, hopefully soon 🤞
👍 1
I also figured that we didn't need to call the permission request directly after the app is signed 🙃
I did however manage to create a Kotlin/Native that gets called from the JVM. Not all lost as I'm planning to explore how to use that to access the camera directly 🤞
m
Oh dear .... sorry I should have mentioned that! Anything to do with granting permissions on macOS requires apps to be signed. The Xcode tooling creates a .app and signs it automatically as part of the build process, the compose tooling being based on the JVM world does not. If you use Conveyor, then you can use
./gradlew jvmJar && conveyor run
to spin up the app in a fully bundled and signed state.
p
I've made my own plugin that looks up in the keychain and tries to sign the app 😅 I may try to adapt it to the compose plugin if I get time.