Hi, I'm trying to create a batch request for facebook. I was looking at their documentation here but I'm pretty confused on how this would integrate with Ti.Facebook. More specifically, I don't know what I should I put for the path and params arguments on Ti.Facebook.requestWithGraphPath.
Has anyone done this before? Any help would be much appreciated. (Ti SDK 2.1.3RC / iOS)
2 Answers
I would suggest that you post some code for what you have attempted so far
Also there are multiple questions already in the forum and in the KitchenSink examples that explain how the graph API work.
Finally for batching multiple asynchronous calls, I think this sample should help
http://developer.appcelerator.com/question/121373/httpclient-best-practices
I tried the same thing using the following function but it doesnt work...
function facebookMultiplePost(userIDs){ if (Titanium.Network.online == true){ if(Titanium.Facebook.loggedIn){ Ti.API.info('FACEBOOK - facebookMultiplePost() EXECUTING'); var batchRequests = [{"method":"POST", "relative_url":"100002463617383/feed", "body":"message=testing multiple wall posts"}]; Titanium.Facebook.requestWithGraphPath('batch', {"method":"POST", "relative_url":"100002463617383/feed", "body":"message=testing multiple wall posts"}, "POST", function(e) { if (e.success) { Ti.API.info('FACEBOOK - Success in posting multi-message'); } else { if (e.error) { Ti.API.info('FACEBOOK - ERROR in posting multi-message '+e.error); } else { Ti.API.info('FACEBOOK - UNKNOWN response in posting multi-message'); } } }); } else { Ti.API.info('FACEBOOK - NOT logged in'); } } }I want to post to multiple friend's walls..and I wouldn't want to do it in a loop...
Your Answer
Think you can help? Login to answer this question!