1

I have an app that kicks off a GET execute on our company server to generate a chart based on a map click. It's working on multiple iOS devices but not on Android. When I watch the Network tab in the Weinre debugger, the GET request takes about 2 seconds from an iOS device. On Android it just hangs on "pending" forever. Is there something I need to add to the config.xml or html index for Android to be able to communicate with the remote server? I commented out the content security policy in the html index because nothing worked with it on.

Bill Hambone
  • 157
  • 2
  • 14

1 Answers1

1

The most likely culprit is missing the whitelist plugin. To install do a cordova plugin add cordova-plugin-whitelist

cordova-plugin-whitelist Docs

If you don't want to restrict anything (good for most cases), add the following to your config.xml:

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
BShaps
  • 1,344
  • 7
  • 17
  • Plugin whitelist and all those intents are in my config.xml file already. What about this line? – Bill Hambone Apr 02 '18 at 20:41
  • The market:* allows links to other apps on the play store. If the request is going through and hanging, I'd check your server to make sure it is sending a response. – BShaps Apr 02 '18 at 23:02
  • The request is not getting to the server. I see no messages there. Again, the requests go through in about two seconds when coming from iOS devices. – Bill Hambone Apr 03 '18 at 15:12
  • I just uploaded the .apk to appetize.io and it worked perfectly. Only one of my coworkers has an Android phone and the app won't work for him. I'm not seeing any errors in the debugger, so I'm not sure what the problem is. – Bill Hambone Apr 03 '18 at 19:00