PDA

View Full Version : How do you handle FB asynchronous requests?




mrl72
Jan 10, 2011, 08:44 AM
So I'm working on my app that connects to FB, gets my user info then pulls down my friends and then pulls down friend details. Right now I am using the FB SDK to connect and authenticate and then the Graph API to issue the individual requests for information. All works good, except even though I fire the requests off separately if one request takes longer than the other then I get results out of sequence. Ideally I want to do things in order as I have other stuff relying on the order these requests are executed.

Any thoughts on how to do this?

Cheers.



dejo
Jan 10, 2011, 10:03 AM
The trick lies in setting up your delegate callbacks properly.

mrl72
Jan 10, 2011, 10:38 AM
Thanks dejo - do you mean how it handles the response ie in the didLoad method? That's currently where I'm putting my parsing code for both of my Graph API calls. Not sure what else you could mean..

Cheers.

dejo
Jan 10, 2011, 11:26 AM
Perhaps if I can see some code I can explain better.