Chapter 8. Using Cordova plugins
This chapter covers
- Managing native features of a device with Cordova plugins
- Using Cordova to more easily integrate with a device
- Improving the resort app with a camera and photo book
- Improving the weather app with geolocation
The apps you’ve built so far in this book have been able to do quite a wide range of interesting things, but you haven’t been able to take full advantage of a device’s features. In this chapter we’ll focus on how you can use Cordova’s community of plugins to enrich your apps through deeper integration with the device.
You’ve been using Cordova for your apps the entire time, because Cordova is the platform you use to wrap your web applications into a native web app. Cordova comes with a core set of features and uses a plugin system to extend the feature set. Plugins provide a way to use JavaScript to implement native features, such as the camera, instead of using the native platform language.
We’ll look at ngCordova, which is an Ionic community–driven project that makes it easier to integrate many common Cordova plugins with Angular applications like Ionic. When possible, you’ll want to use ngCordova instead of just the plugin itself.
Then we’ll look at several examples of using Cordova plugins to extend the apps you built earlier in the book with native features. Regardless if you did the examples in the earlier chapters, you’ll need to set up the completed project before you begin.