Device

The first plugin we are going to look at in this section is the device plugin. This plugin describes the device's hardware and software specifications.

You can know more about this plugin here: https://github.com/apache/cordova-plugin-device or https://ionicframework.com/docs/native/device/.

Let us scaffold a new blank app and then add the device plugin to it:

ionic start -a "Example 16" -i app.example.sixteen example16 blank --v2

Once the app is scaffolded, cd into the example16 folder. Now we will add the device plugin, run the following command:

ionic plugin add cordova-plugin-device

This will add the device plugin. Once that is done, we will add the Ionic native device module. Run the following command:

npm install --save ...

Get Learning Ionic - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.