The following is what I did to setup Ionic in Chrome App for Mobile:
- Created a Chrome App for Mobile project -
cca create projectname
- Created an Ionic project
ionic start projectname_ionic
- Deleted all of the files from the Chrome App www folder except the manifest files and background.js -
find projectname/www/* -not -name 'manifest*' | grep -v 'background.js' | xargs rm -rf
- Copied the content of the Ionic project www folder to the Chrome App www folder -
cp -r projectname_ionic/www/* projectname/www/
- Commented out
<script src="cordova.js"></script>
at projectname/www/index.html since cca automatically inject it already
When trying to run the project I get the following error from app.js line 14 -
Uncaught TypeError: Cannot read property 'Keyboard' of undefined
When typing at the console of Chrome dev tools (remote debugging) window.cordova
I do get an existing object, so the problem is that window.cordova.plugins is undefined.
btw the app itself does load up at the mobile and I can switch tabs, but at the Friends tab when I click on a name I do see that it got clicked but nothing happen beside that.
I also tried the following:
- projectname_ionic/plugins had 3 plugins which projectname/plugins missed so I added them using cca plugin add ... to projectname/
- Run
ionic platform add android
at projectname_ionic/ before copying the files - Tried few older versions of Ionic (desperate I know :))
- And some other tries which I forgot already...
Anyone got an idea what should I do?
Thanks in advance!