Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

iOS 7 -> iOS 8 HTTPClient issues

$
0
0

I'm making a time tracking app. Developing my app on ios 7, everything worked perfectly. After I upgraded to ios 8, not so much.

I'm using a custom version of the restsql adapter here - https://github.com/viezel/napp.alloy.adapter.restsql

I can retrieve lists of data without any issues. The problem seems to be when I want to zero in on a specific record. So, for example, I can retrieve all of a users time sheets and the time entries associated with them, but when I try to view an individual time entry, I get an error back ..

{
      code = "-1017";
      error = "cannot parse response";
      source = "[object TiNetworkHTTPClient]";
      success = 0;
      type = error;
}
I've tested the request out in Postman (chrome extension) and the result returned looks fine to me (and also passes validation on several different websites)...
{
    "entries": {
        "TimeEntry": {
            "id": "...",
            "user_id": "...",
            "timesheet_id": "...",
            "time_in": "2014-09-15 00:47:00",
            "time_out": "2014-09-15 05:40:00",
            "rounded_time_in": "2014-09-15 00:47:00",
            "rounded_time_out": "2014-09-15 05:40:00",
            "ip_address_in": "192.168.2.59",
            "ip_address_out": "192.168.2.59",
            "source_in": "app",
            "source_out": "app",
            "source_out_id": "",
            "notes_in": "",
            "notes_recording_in": "",
            "notes_out": "",
            "notes_recording_out": "",
            "active": true,
            "status": "0",
            "approved_on": null,
            "approved_id": "",
            "created": "2014-09-15 05:43:08",
            "created_id": "...",
            "modified": "2014-09-17 02:44:37",
            "modified_id": "...",
            "deleted": null,
            "deleted_id": "",
            "pushed": true,
            "time_worked": "17580"
        }
    }
}
I thought that there may be a problem with the sqlrest adapter, so I tried to make the request by creating my own Ti.Network.HTTPClient completely outside of the adapter (in index.js just to test), and even that fails with the same result.

I've been fighting with this for over a week now and it's going to drive me insane. I can't figure out what is causing the problem and it didn't happen until I upgraded to ios 8. I've got the newest Titanium SDK (3.4.0 GA) and my app is set to use it in the tiapp.xml file. I've got the newest Xcode installed and all my software is up to date.

Based on what I've found, the error (-1017) seems to actually be a NSURLErrorCannotParseResponse error which, according to the Apple docs is "Returned when a response to an NSURLConnection request cannot be parsed."

So, my question is, what the hell is wrong with my response that it can't be parsed? Am I doing something wrong or missing something? This is the first app I've written in Titanium so I'm inclined to believe that it's me and not Titanium... At least I hope that's the case.

Any help would be greatly appreciated since I'm so close to having the app done, having to rewrite the whole thing in Obj-C or Swift is something I would prefer to avoid :-)


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>