Begging for a working Cocoonjs AJAX Object/Plugin

Discussion and feedback on Construct 2

Post » Tue Mar 26, 2013 9:08 pm

Begging for a working Cocoonjs Ajax Object/Plugin.
Please Construct2 devs or plugin devs i beg you, can you make a CocoonJS IOS/Android working AJAX object/plugin. With the same functions as the standart AJAX in construct2 like request and post.

And my suggestion to Scirra devs is; why don't you make special objects for CocoonJS to make it easy for us to creat great mobile games. It would be awesome if these Objects only showed up when a CocoonJS project created, instead of the standart Objects that give issues in CocoonJS.

Sorry for my bad english,

Thanks for reading have a nice day..stctr2013-03-26 21:10:38
B
31
S
10
G
2
Posts: 310
Reputation: 5,426

Post » Tue Mar 26, 2013 10:23 pm

The existing AJAX object is supposed to work, but it doesn't due to bugs in CocoonJS. We've asked Ludei to fix it!
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554

Post » Wed Mar 27, 2013 2:35 am

I'm pretty sure you don't know how to apply Cross Domain origin.

Sometimes CocoonJS can't access to get files via AJAX due to CORS policy.

I made a php file which allows CORS to every places. I hosted it on my server.


Create a file
----------------------------------------------------------
<?php
header('Access-Control-Allow-Origin: *');
?>

Insert your a wall of text here

-----------------------------------------------------------


Then upload at your server, make a .capx, grab your php file from server and export to CocoonJS, it worked like a charm.


I hope it helps you, otherwise you need to give more explanation.



B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Wed Mar 27, 2013 1:35 pm

I just tried the latest CocoonJS launcher on Android and the AJAX requests don't seem to work still even when CORS is used. @Joannesalfa, were you testing on iOS?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554

Post » Wed Mar 27, 2013 4:15 pm

@Joannesalfa

Like Ashley i tried and same results on Android CocoonJS launcher.

I saw the Clay.IO plugin, i think they use something like AJAX to make request and post. I don't want to use a plugin like that because, i don't want my games to connect unknown servers that are not in my control.

I know enough PHP to code my own site like clay.io, but i don't know enough Javascript to develop my own AJAX plugin and the one that Construct2 provides is not working. Ashley can you provide us an Plugin that does basic Post/Request functions please. I realy need it. Maybe in the next update?

Sorry for my bad english,

Thanks for reading have a nice day..
B
31
S
10
G
2
Posts: 310
Reputation: 5,426

Post » Wed Mar 27, 2013 5:08 pm

Well, I looked further in to the AJAX object on CocoonJS. I eventually managed to isolate the bug in CocoonJS and work around it. So hopefully the AJAX object will be working on CocoonJS in the next build!
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554

Post » Wed Mar 27, 2013 5:46 pm

Thank you very much Ashley.
B
31
S
10
G
2
Posts: 310
Reputation: 5,426

Post » Wed Mar 27, 2013 5:47 pm

so just to make sure. Even local json/xml files that are needed to load with ajax won't work. That sounds crummy. Well hopefully it will be fixed next build ;) going to need it soon :P
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Thu Mar 28, 2013 2:45 am

[QUOTE=Ashley] I just tried the latest CocoonJS launcher on Android and the AJAX requests don't seem to work still even when CORS is used. @Joannesalfa, were you testing on iOS?[/QUOTE]

Yes, i tested on iOS iPod touch 4, i have an android tablet, the problem is i was unable login with my existent registration code in cocoonjs launcher, then i emailed to Ludei and they didn't reply me :/
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Thu Mar 28, 2013 1:51 pm

I tested AJAX on CocoonJS loading local files, and that seemed to work too. So hopefully everything will be good.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,554

Next

Return to Construct 2 General

Who is online

Users browsing this forum: slothboy, Thirstyy and 12 guests