Installing Ionic Native

We can add Ionic Native to any existing Ionic project. You will find ionic-native by default in any starter project you will start with Ionic 3. If you somehow have to install it then the recommended way is via the NPM package:

    $ npm install @ionic-native/core --save

If you are using ES6/TypeScript for building Ionic 3 apps, you do not need any scripts tags to be included in the index.html file. Just import the specific ionic-native package inside your file:

 

import { SplashScreen } from '@ionic-native/splash-screen'import { StatusBar } from '@ionic-native/status-bar';

If you are using Ionic 1 then you need to add the ionic.native.js file inside the index.html file:

    <script src="ionic.native.js"></script>

Get Hybrid Mobile Development with Ionic 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.