Example app shows some possibilities of cordova-background-geolocation plugin.
Name | Version |
---|---|
Cordova CLI | 7.1.0 |
Cordova-Android | 6.3.0 |
npm install
npm run build
* App will be built into www
folder.
Edit variable GOOGLE_MAPS_API_KEY
in www/index.html
Replace platform with one of supported platforms: android, ios. In this example we will build for Android.
cordova platform add android
cordova build android
There is after_platform_add hook in config.xml which runs script that install all required plugins.
You will need to install ios-deploy package.
npm -g install ios-deploy
cordova run ios --device
cordova run android --device
You will need to install ios-sim package first
npm -g install ios-sim
Run in default emulator
cordova emulate ios
You can use cordova run ios --list to see all available targets and cordova run ios --target=target_name to run application on a specific device or emulator (for example, cordova run ios --target="iPhone-6").
To deploy the app on a default Android emulator.
cordova emulate android
You can use cordova run android --list to see all available targets and cordova run android --target=target_name to run application on a specific device or emulator (for example, cordova run android --target="Nexus4_emulator").
Cordova Example App is sharing code with react-native variant. Native libraries are aliased to use their web variants. That is possible thanks to amazing webpack, native-base-web, react-native-web projects.
For development install and use webpack-dev-server:
webpack-dev-server --content-base src/
If you're using XCode, boot the SampleApp in the iOS Simulator and enable Debug->Location->City Drive
.