When I\'m running my Ionic app with ionic serve -l command, get following error message:
Runtime Error
Unca
Cordova is only accessible when you run your app on a real device. When you test your app in the browser, it cannot access those native plugins.
You can check if you are on a real device or a browser like that:
if (this.platform.is('cordova')) {
// You are on a device, cordova plugins are accessible
} else {
// Cordova not accessible, add mock data if necessary
}
This will only help you test the parts of your app that don't rely on cordova plugins. To really test your app, you need to run it on a device or in the emulator.