[SOLVED] App.request problem


#1

Hi guys,
I am executing the following request

app.request.json("https://www.mydomain.com", 
    { seconds: 31556952, username: input_username, password: inp_password
}, function (cookie){
    console.log(cookie);
}, function (error){
    console.log(error);
});

The answer I get from Google Chrome or PhoneGap Developer APP it returns the console.log(cookie), but when I execute the .apk file on my phone it returns the console.log(error).

GET https://www.domain.com 404 framework7.js:3772 (Not Found)

Any Ideas why?


#2

Make sure you have whitelisted request URL in your config.xml


#3

Still not working

<access origin="*" />
<access origin="https://www.diecast-collections.com" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

#4

Try also

<allow-navigation href=“*” />

#5

Nope. Still not working.


#6

@nolimits4web, which one should I use?

  <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap:" />
  <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' data: gap:" />

#7

Problem Solved. Missing whitelist plugin

<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />

Basically for <allow-navigation href=“*” /> need the above plugin.