1.

How you get a user's current location in an ionic framework? How can you access mobile phone native functionality in Ionic applications, for example, the camera?

Answer»

Ionic does not PROVIDE a camera API. However, since Ionic uses plugins architecture, and it is based on CORDOVA, we can use Cordova plugins in our application. The ionic team supplies a set of Cordova extensions with Angular wrappers which can be found at ngCordova. To be able to use Cordova plugins, we need to INSTALL the plugin using Ionic command install <plugin name>. In some cases, we additionally need to add the plugin’s Angular module to your Angular application. To use a mobile phone’s camera app in the Ionic application, we can call the camera API by using cordova-plugin-camera that is HOSTED on GitHub. Now, this plugin defines a navigator.camera object which provides  API for taking pictures and for choosing images from the system’s image library.



Discussion

No Comment Found