Search code examples
iosswiftswiftuiapple-watch

Can I use the camera of my IPhone on my Apple-Watch to scan a QR-Code (eg. for login) in SwiftUi


I want to simplify the login on my Apple-Watch-App by scanning a QR-code. The only problem is I can't really find any documentation on how to use the Iphone camera when programming an Apple-Watch-App. Im programming in SwiftUi. I would appreciate any type of help. Thanks in advance.


Solution

  • The QR code would need to open the companion app on the phone and then the phone would pass the login details to the watch app via WCSession. So in Order to use the camera, you always need a companion app, a watch-only app is not able to access the camera. Thanks to @Paulw11