Ionic - no internet connection


#1

I’m building an app for Android with Ionic/Cordova. The app works fine in the emulator and works fine in the Ionic view app.
The app connects to an API in our internal network and everything works fine.

The problem is, when I build the cordova app to Android and install
the apk, it doesn’t connect to the internet. I can’t seem to find what
the problem is and why it is not connecting, even though it does work in ionic serve


#2

You Can debug you ionic application, Have you check internet in you ionic application . You need to check internet is working on device or not.

See this article showing how to check internet in ionic application. http://goo.gl/0NNYJ3

You can debug you ionic application on chrome with command “chrome://inspect”, Must enable usb debug on mobile.


#3

but the connection was working when l was using ionic serve


#4

Have you install Cordova Whitelist plugin, including a security meta tag?


#5

no, am trying tht now


#6

it working but the docs say the for testing only…
am working on a production app


#7

Security meta tag used in documentation will accept anything.

If you know what you’re doing, you can make it more conservative for your production app. But you don’t need to do that unless you’re working on an application where security is imperative/important.