How to use Native Camera in Ionic project, ionicnative

Source: Internet
Author: User

How to use Native Camera in Ionic project, ionicnative

This article describes how to use the camera of a device in an ionic project.

Ionic version: v3.2.0/2017-05-10/MIT Licensed/Release Notes

1) The first step is to install ionic-native/core. All functions that use Native cannot be saved in this step. Npm install @ ionic-native/core -- save

Ps: for the first step, the official note is that ionic-native/core is included in every Ionic application by default. Note the red rectangular text.

In other words, if the development environment is the latest version and the Ionic version has not been upgraded during this period, you can skip this step without manual installation by the developer.

However, in the actual development process, you may encounter the following problems:

The reason is that the upgrade... Upgrade... Upgrade. My project was created based on Ionic v2.2.2. However, I have been officially upgraded to v3.2.0 through Ionic.

The solution is:

2) Add the cordova plug-in to your project. Ionic cordova plugin add cordova-plugin-camera

3) install the corresponding node_moudles. Npm install -- save @ ionic-native/camera

4) Find the app. moudle. ts file under the Code src-> app and Add this plugin to your app's module. This step can be done at the end, but do not forget.

5) The other is to add code on how to use Camera.

6) After coding is complete, use Chrome to test the cordova plug-in.

Ionic cordova platform add browser

Ionic cordova run browser

For more information about the reason why the ionic serving is not direct, see commit.

Refer:

Ionic Official Website: http://ionicframework.com/docs/native/camera/

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.