In my app I need to use the network information plug-in so to add it I ran the command:
ionic plugin add cordova-plugin-network-information
In my Ionic 1 apps I always used ionic plugin add to add my plug-ins as the plugin is then automatically added to the package.json file (which I assumed was good).
Anyway, after adding the plugin (and without adding any code to actually use it) I built the app and tested it on a device. The app crashed on loading (no errors in the log - just crashed on startup). I removed the plugin and added it again and re-tested. Same thing happened.
Then I tried removing the plugin and adding it back again but this time using:
cordova plugin add cordova-plugin-network-information
This time when I built the app, it worked. What’s the difference between using the ionic plugin add and the cordova plugin add commands? I thought the only difference was the entry in package.json but presumably there are other differences?