ionic安装拍照选照片插件

1、安装插件,也可以用ionic plugin add ....

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git

2、打开android项目,添加权限配置

--> app/res/xml/plugins.xml

<plugin name="Camera" value="org.apache.cordova.CameraLauncher" />

--> app/AndroidManifest

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

 

<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" />

<uses-feature android:name="android.hardware.camera.autofocus" />

example:https://github.com/paulorbpacheco/CameraTest-Cordova.git

原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/4856593.html