Facebook batch request request in objective-c

Does anyone have a request with this? I can't figure it out, and now I am sending as 75 separate HTTP requests that don't seem smart, and I am facing problems with such a large multi-instance.

(Although, with a batch request, I’m worried that you are more likely to save time, because sending it back will lead to more results that may be lost over 3G).

Could anyone program a batch request in objective-c OR do you have other suggestions for very large requests? I know its correct form for attaching code, but I could not even figure out where to start.

+3
source share
1 answer

API- Graph, :

curl \
    -F 'access_token=…' \
    -F 'batch=[ \
            {"method": "GET", "relative_url": "me"}, \
            {"method": "GET", "relative_url": "me/friends?limit=50"} \
        ]'\
    https://graph.facebook.com

, 50 .

Facebook iOS SDK ( facebook - Facebook):

NSString *req01 = @"{ \"method\": \"GET\", \"relative_url\": \"me\" }";
NSString *req02 = @"{ \"method\": \"GET\", \"relative_url\": \"me/friends?limit=50\" }";
NSString *allRequests = [NSString stringWithFormat:@"[ %@, %@ ]", req01, req02];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:allRequests forKey:@"batch"];
[facebook requestWithGraphPath:@"me" andParams:params andHttpMethod:@"POST" andDelegate:self];
+8