0

I am updated phonegap build 6.3.4 (Cordova 6.4.0). Until now all ajax calls to server was working fine. It suddenly stopped.

I faced a similar situation with iOS build and it turned to be a a new addition to the Content-Security-Policy. I am wondering if anything has been added for Android?

Finally, is there a proper information on the content-security tags to be added?

plugins

cordova-plugins-whitelist

config.xml

    <access origin="http://*" />
    <access origin="https://*" />
    <allow-navigation href="*" />
    <allow-intent href="*" />

index.html

<meta http-equiv="Content-Security-Policy" content="img-src * 'self' data:; default-src * 'self' gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';">
sabkaraja
  • 342
  • 4
  • 15

1 Answers1

0

When you have done everything and still ajax isnt working, its time to look at your SSL. My aha moment was when app worked in debug but not in release mode.

That led to this thread here. Due to wrong SSL implementation Android doesnt detect the certificates.

In Debug mode, android overrides the SSL issues (so it worked). In Release mode it failed silently and caused the problem.

I updated the root certificate / intermediate certificate / site certificates to resolve it

Community
  • 1
  • 1
sabkaraja
  • 342
  • 4
  • 15