igul222 / YefChat

[defunct] Snapchat client for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

startRefreshWithCallback breaks

sambudda opened this issue · comments

I had to change a few variables for login to work like this

define USER_AGENT @"Snapchat/6.0.2 (iPhone; iOS 7.0.4; gzip)"

define URL @"https://feelinsonice-hrd.appspot.com/bq"

but now startRefreshWithCallback breaks with the following error. Basically all_updates doesn't work. I used these variables.

data[@"timestamp"] = @(ts);
data[@"username"] = _username;
data[@"req_token"] = [self hashFirst:_authToken second:[NSString stringWithFormat:@"%li", ts]];
//data[@"version"] = @"6.0.2";

2014-02-22 15:52:40.478 Yefchat[37559:a0b] _authToken: a57a9e90-9d6d-40e9-82ba-6bb05260445e ...

2014-02-22 15:52:40.742 Yefchat[37559:a0b] operation 2: <AFHTTPRequestOperation: 0x8a32150, state: isFinished, cancelled: NO request: <NSMutableURLRequest: 0x8a03480> { URL: https://feelinsonice-hrd.appspot.com/bq/all_updates }, response: <NSHTTPURLResponse: 0x8db6f30> { URL: https://feelinsonice-hrd.appspot.com/bq/all_updates } { status code: 400, headers {
"Alternate-Protocol" = "443:quic";
"Cache-Control" = private;
"Content-Encoding" = gzip;
"Content-Length" = 167;
"Content-Type" = "text/html; charset=utf-8";
Date = "Sat, 22 Feb 2014 20:52:30 GMT";
Server = "Google Frontend";
Vary = "Accept-Encoding";
"X-Snapchat-Jobs" = "Work with us, make Snapchat even better! -- Visit http://bit.ly/sc-api -- Mention this header for bonus points.";
} }>
2014-02-22 15:52:40.744 Yefchat[37559:a0b] Error 2: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x8a7db30 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

There is an updated function of the API, /updates instead of /all_updates [reference]

I believe the formatting of the JSON response is slightly different too which will cause a crash unless the startRefreshWithCallback function is modified to parse the new response.