Using the iOS SDK for Facebook, let's say I execute a graph request for a user profile image:
[FBRequest requestForGraphPath:@"me/picture"]
I will get this error:
Response is a non-text MIME type; endpoints that return images and other binary data should be fetched using `NSURLRequest` and `NSURLConnection`.
What is the reason for this? It only takes a minute to write a request manually, but why is this common task not included in the SDK for iOS Facebook or am I missing something?
Looking through the Facebook iOS SDK repository on Github, we see this in FBRequestConnection.m :
if (!error && [response.MIMEType hasPrefix:@"image"]) { error = [self errorWithCode:FBErrorNonTextMimeTypeReturned statusCode:0 parsedJSONResponse:nil innerError:nil message:@"Response is a non-text MIME type; endpoints that return images and other " @"binary data should be fetched using NSURLRequest and NSURLConnection"]; }
If I understand correctly, the FBRequestConnection receives the response that I want (i.e. the profile picture), and THEN tells me that I cannot receive it. Which tease. Why make a request in the first place?
Any comments on this?
source share