[SOLVED] Issue with AJAX on Mobile Device (iOS)

Get help using Construct 2

Post » Thu May 15, 2014 11:12 am

I have a problem with loading a json into an array.
Mostly it works fine. But there are some files who cannot load into an array.
This issue is only on the Mobile Device. On PC and iOS Simulator the app is working fine.

At first I thought the problem is the array. But now I've seen that the lastData of the Ajax object is empty on loading completed.
> ONLY on the iOS Mobile Device (iPhone 5s). But other JSONs are working. The array size its not really decisive.
x,y,z = summary: result
1100,5,1 = 5500: is working
808,7,1 = 5656; is not working
698,12,1 = 8376; is not working
88,1,1, = 8376; is not working

The JSON is 100% compatible to the Array.

As I said: The problem is the AJAX Object.
On Ajax "ajax" completed -> Ajax.lastDate = ""; (Tested with a text object.)

On the iOS Emulator (xcode) the game is working fine. AJAX load ALL JSONs. But on the real device the AJAX just load a few of JSON-Files. Strange!
Last edited by DAG on Fri May 16, 2014 4:16 pm, edited 1 time in total.
B
13
S
4
G
1
Posts: 107
Reputation: 1,337

Post » Fri May 16, 2014 12:10 am

has anyone tested? there's no iOS developer here? who worked with ajax on iOS Device?
Ok, if there is someone who is interesset to test it, I will create a example project. Just asking for it. Whether it's worth it. Thanks!
@Ashley: I have the problem on all iOS JS Runner like Ejecta and CocoonJS. But as I said: Only on the "iOS Device" (real physical) load the AJAX not all of the json-files. just a few. But the ios simulator / emulator and on PC the AJAX working great.
At first I thought its a issue of file permission or memory management of array or string length. But I have this problem also on files with a array size of 88x1x1. I have array sizes about 6000 and more. for example a file with 5500 size is working fine. but some greater files are not working. but also the small files (88 size). I'm going mad!
The Event Handling loads the ajax data into the array successively. ... All working awesome on all other platforms but iOS Device. -.-
The AJAX jumps into the successful method "On "" completed". But the lastData string is empty.
How can I debug this? I just have a text object to display the Ajax.lastData.
Please help me! =)
B
13
S
4
G
1
Posts: 107
Reputation: 1,337

Post » Fri May 16, 2014 8:43 am

Share a .capx demonstrating the problem. It would be helpful to also reduce the problem to either something wrong with the AJAX requests, or something wrong with the array.
Scirra Founder
B
397
S
236
G
88
Posts: 24,412
Reputation: 194,516

Post » Fri May 16, 2014 4:16 pm

I've solved it!
Omg why I hadn't seen that?

Here's the solution:
Don't use uppercases in the AJAX Request URL string!
Only use lowercases like "myfile.json". But not "myFile.json".
If you use uppercases and run your game on a real mobile device like iOS iPhone 5s or iPad 3 then you get an empty string as AJAX.lastData.

Take a look to the attachment to see a demonstation.
I hope I could help you.
You do not have the required permissions to view the files attached to this post.
B
13
S
4
G
1
Posts: 107
Reputation: 1,337


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo, Lancifer and 23 guests