How to deal with multiple Facebook requests simultaneously
Posted
by
Peter Warbo
on Stack Overflow
See other posts from Stack Overflow
or by Peter Warbo
Published on 2013-07-01T10:19:43Z
Indexed on
2013/07/01
10:21 UTC
Read the original article
Hit count: 186
I'm using the Facebook SDK for my app. I have created a singleton class FacebookHelper
to deal with all Facebook related logic. Whenever I make a Facebook request (i.e download friends) I set an enum i.e FacebookRequestDownloadFriends
so that FacebookHelper
knows how to handle errors and success for that request (since handling can be different between the different requests)
This solution has worked out fine until now, because now I'm doing 2
Facebook Requests at the same time so when I set the enum for the first request i.e FacebookRequestDownloadFriends
and then it will be overwritten just shortly with another request FacebookRequestDownloadEvents
, so there will be confusion obviously.
How can I deal with this issue without having to refactor too much code?
© Stack Overflow or respective owner