Getting started
It's easy to use our sample project for this chapter rather than trying to build something from scratch. You can find this under the /ch5
directory in the code package for this project.
If you want to create a new Cordova project using our project as a base, use a command like the following:
cordova create ./your-directory com.packtpub.pgech5 TaskerCH5 --copy-from ./ch5
Then, add the following plugin (for SSL Certificate pinning):
cordova plugin add https://github.com/EddyVerbruggen/SSLCertificateChecker-PhoneGap-Plugin.git
The project uses https://localhost:4443
as the base URI; you'll want to change this to point at your server. This can be configured by modifying www/js/app/main.js
. Look for the baseURI
variable (around line 121) and modify as appropriate. Once done, you should be able to run the app on your device using one of the following command lines:
cordova run platform-name # ios or android cordova emulate platform-name
There are a lot of files that are contained...