Maybe it has to do with whitelisting urls. I had the same problem accessing a webservice, it would work with ionic serve but not on the device. Take a look here: https://github.com/apache/cordova-plugin-whitelist
What I did was:
- ionic add cordova-plugin-whitelist
- add
<allow-navigation href="*" />
to config.xml - add
<meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-inline' 'unsafe-eval'">
to the header of index.html
Hope this solves your problem.