Search code examples
iosobjective-cquickblox

QuickBlox downloading content receiving QBASIHTTPRequestErrorDomain code 1


I'm using the iOS SDK to access download content from the content module. It seems in the delegate method -(void)completedWithResult:(Result*)result, I can have cases where result.success is YES while result.file would be nil.

-(void)completedWithResult:(Result*)result
{
    if (result.success) { // YES here
        if ([result isKindOfClass: [QBCFileDownloadTaskResult class]]) {
            FileDownloadTaskResult *res = (QBCFileDownloadTaskResult *)result;
            res.file; // This is NULL.
            res.errors; // This is an empty NSArray
        }
    }
}

Console log prints this message:

<QBASIHTTPRequest: 0xc26d200>
headers:(null)
body:
error:Error Domain=QBASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0x9f27a50 {NSUnderlyingError=0x9f18300 "The operation couldn’t be completed. Connection reset by peer", NSLocalizedDescription=A connection failure occurred}

Is this normal? I would expect in this case res.success a NO.


Solution

  • Let's try latest version of iOS SDK 1.8

    http://quickblox.com/developers/IOS#Framework_changelog:

    Here is one big change:

    replaced core network library ASIHTTPRequest with AFNetworking