I’ve been building out a webapp using react. It’s completely responsive and developed in device mode.
Once I was happy with it’s behavior in browsers I decided it was time to port it as a native mobile app. Below we assume the whole application has been compiled with Browserify or Webpack into an app.js file. I’m also assuming es6 syntax and inline styles.
- declare cordova.js before your bundle. This is automatically injected by Cordova at runtime.
- declare a viewport meta tag to prevent resizing
- declare a Content Security Policy. Read Cordova-plugin-whitelist.