ACS - Bug in retrieving Objects on While on Web (works locally)

You must Login before you can answer or comment on any questions.

There is an error while getting an "Object" of a User while running in a Web App hosted on a server, though it works if the App is running from my computer.

sdk.sendRequest('objects/status/query.json', URLRequestMethod.GET, data, getObjConfirmation);

works fine while debugging from my computer, though it returns nothing if it's hosted on a server.

— asked 11 months ago by Joseph Sacha
1 Comment
  • This is a fairly important bug! Please vote up if you think Appcelerator needs to fix this.

    — commented 11 months ago by Joseph Sacha

3 Answers

Hello Aaron,

Thanks for inquiring. So on creation complete of the App, the below code gets called:

public var sdk:Cocoafish = new Cocoafish('API long alphanumeric');

onCreationComplete():void {
var data:Object = {};
sdk.sendRequest('objects/status/query.json', URLRequestMethod.GET, data, true, getStatus);
}
then once that requests happens, getStatus fires:
private function getStatus(data:Object):void {
                if(data) {
                    if(data.hasOwnProperty("meta")) {
                        var meta:Object = data.meta;
                        if(meta.status == "ok" && meta.code == 200) {
                      // we have access to the status Object
                       trace(data.response.status[0].locations);
                                                  ...
This works fine while running (debugging) locally, but once I host this on my server, it stops working. I assume it may have cross-domain issues, because only when it's hosted on a server that the call dosen't get through.

— answered 11 months ago by Joseph Sacha
answer permalink
4 Comments
  • it is/ was a cross domain issue, but I believe this was resolved in a later release of the javascript SDK, are you sure you have downloaded the latest?

    — commented 11 months ago by Aaron Saunders

  • I am working on the Cocoafish vers. 1.1 for AS3. I really, really hope updates this will be added as well.

    — commented 11 months ago by Joseph Sacha

  • I noticed the last update on GitHub for the AS3 lib to version 1.1, this is the one I am using.

    — commented 11 months ago by Joseph Sacha

  • Show 1 more comment

Solved: For it to work in Web

sdk.sendRequest('objects/status/query.json', URLRequestMethod.GET, data, false, getStatus);// 4th param should be false, not true

We have built multiple applications using ACS on mobile and in websites, can you provide a complete example with a use case where it is failing?

Your Answer

This question has been locked and cannot accept new answers.