How do I send an AJAX request on Mobile via Intel XDK

Get help using Construct 2

Post » Sun Jul 24, 2016 12:24 am

Um Hello,

Idk where i should've put this but I'm sending an AJAX request to my website (goapp-wbackend.rhcloud.com), it's running Go 1.6.3 on the Apache Server with "Content-Security-Policy": "default-src https://goapp-wbackend.rhcloud.com", and I'm trying a GET or POST request on the website, now, it works well in localhost mode, but when I export via Cordovia/IntelXDK, and I build or debug, it gives me an AJAX 404. Plain that. You can test the website and I'll send you a HelloWorld! (as I said, it works well in localhost:8080)

Other Headers: "Access-Control-Allow-Origin":"*"
Image
My Whitelist on Intel XDK:
Image

i've been hitting my head on the wall for a while now, maybe @Ashley can help,
although maybe it's because I need to update JQuery.


EDIT: If anybody got it working, Please post your stuff, I'd greatly appreciate it.
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Sun Jul 24, 2016 7:24 am

The ajax plugin works fine with Intel XDK. The problem is your local server. You can't use it from another device except your PC...
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Sun Jul 24, 2016 2:07 pm

@Saad Swad, it is not local, it is hosted on Openshift and can be accessed by anybody aroubd the world, you can try it. (I just accessed it from my mobile device' chrome browser without any issues. But in XDK, it just gives me plain 404 not found

Edit: If you did get it working please send me youur capx, I'd wanna compare mine eith yours
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Sun Jul 24, 2016 2:50 pm

"Your built app behavior may differ compared to what is displayed in Intel App Preview.
Your project includes Cordova plugisn that are not included in App Preview. These plugins are not supported by App Preview:
cordova-plugin-whitelist"

There is the problem it seems, I'll try including the allow tags in my index.html file
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Sun Jul 24, 2016 3:08 pm

Hi, this zip file contain capx, snapshots and apks : https://www.dropbox.com/s/2h4fo19gp0ghzyj/Ajax.rar?dl=0
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Sun Jul 24, 2016 5:34 pm

@Saad Swad, Oh, I got it working, Thank you!

Apparently I had to set the permissions for media, otherwise I couldn't use AJAX
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Sat Sep 10, 2016 12:17 am

Hey guys...I'm going through the same problems. How do you solve?

I'm using AJAX plugin (with GET and POST method request)...on my PC, it works fine, but on my android, it fails.

My intel xdk is 3522 (with Cordova CLI 6.2.0).

Please, help me.
B
34
S
18
G
14
Posts: 12
Reputation: 9,859

Post » Fri Feb 03, 2017 7:50 pm

Hi, @marciolevi
You have to go in the parameters of your app, in the permissions section, check if your phone allow "Media" to your app.
B
17
S
10
G
19
Posts: 140
Reputation: 11,457


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 6 guests