How to access camera in Ionic app

Author - Varun Chopra
6.03.2019
|
0 Comments
||

Steps to access camera in Ionic app
To access camera to capture image inside ionic application you can use camera plugin.

Installation:
$ ionic cordova plugin add cordova-plugin-camera
$ npm install @ionic-native/camera

Supported platforms are as follows:

1. Android
2. Browser
3. iOS
4. Windows

Note: To add any of the plugins in ionic you first need to import it into app.module.ts file
import { Camera, CameraOptions } from ‘@ionic-native/camera’;

import { Camera } from ‘@ionic-native/camera’;

@NgModule({
declarations: [
MyApp
],
imports: [
IonicModule.forRoot(MyApp),
],
entryComponents: [
MyApp
],
providers: [
Camera,
{ provide: ErrorHandler, useClass: IonicErrorHandler }
]})

Use:
First import the plugin into the page in which you want to use the camera.

Ionic app

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *