I am trying to integrate Quickblox chat into an existing Objective C (Xcode) application. The method below which had worked in another application is meant to send attachment to the chat dialog.
dispatch_async(dispatch_get_main_queue(), ^{
[QBRequest TUploadFile:imageData
fileName:@"test.png"
contentType:@"image/png"
isPublic:NO
successBlock:^( QBResponse * _Nonnull response, QBCBlob * _Nonnull uploadedBlob )
{
QBChatAttachment *attachment = [[QBChatAttachment alloc] init];
attachment.url = uploadedBlob.privateUrl ? uploadedBlob.privateUrl : uploadedBlob.publicUrl;
attachment.ID = uploadedBlob.UID;
attachment.name = uploadedBlob.name;
attachment.type = @"image";
if ([strongSelf.delegate respondsToSelector:@selector(attachmentBar:didUpLoadAttachment:)]) {
[strongSelf.delegate attachmentBar:strongSelf didUpLoadAttachment:attachment];
}
} statusBlock:^(QBRequest * _Nonnull request, QBRequestStatus * _Nonnull status) {
CGFloat progress = status.percentOfCompletion;
[strongSelf updateLoadingProgress:progress];
} errorBlock:^(QBResponse * _Nonnull response) {
if ([strongSelf.delegate respondsToSelector:@selector(attachmentBarFailedUpLoadImage:)]) {
[strongSelf.delegate attachmentBarFailedUpLoadImage:strongSelf];
}
}];
});
but the succesBlock callback kept throwing expected ')' error
successBlock:^( QBResponse * _Nonnull response, QBCBlob * _Nonnull uploadedBlob )
The full error is as shown in the screenshot below
What am I doing wrong.