Search code examples
angularionic-frameworkionic4progressive-web-appscapacitor

Ionic Capacitor camera plugin


i'm using Ionic with Capacitor and camera plugin, it's work fine on native mobile(Android), but i want to be able work with local(server on Chrome), but i'm getting the following error: enter image description here

The following steps already done:

  • npm install @ionic/pwa-elements
  • defineCustomElements(window); in Main.ts
  • Plugins.Camera.requestPermissions(); in my camera service.

I wrote my code based on the Capacitor blog

The only thought that comes to mind is, it's appear because i'm using desktop computer and i don't have a camera, but if so how can i handle it?

Any suggestion will blessed:) Thanks!


Solution

  • You are getting an error because there is no Camera. "Requested device not found" means the Camera was not found.