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

0 favourites
  • 4 posts
From the Asset Store
Shark.io
$49 USD
Shark.io in the sea full of killer sharks, Sunday of life is the game. Who knows what is happening under the sea?
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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! =)

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)