0

I have to post image to facebook and twitter.The requirement is to provide a progressive HUD which says how much data has been uploaded.Is there any delegate method in facebook sdk or twrequest to know the amount of data uploaded to respective server

JJJ
  • 32,902
  • 20
  • 89
  • 102
Mohan Kishor
  • 59
  • 1
  • 1
  • 6
  • It depends what API you are using; care to tell us which one you have chosen? – trojanfoe Mar 16 '13 at 10:05
  • For facebook,i am using https://graph.facebook.com/USER_ID/photos api.For twitter,i am using https://api.twitter.com/1.1/statuses/update_with_media.json – Mohan Kishor Mar 16 '13 at 10:44

1 Answers1

0

This is not a direct solution to the problem but I'm putting some reference direct from respective service SDK that will point you to somewhere at least,

Facebook,

See Facebook SDK 3.2 for iOS Reference there you can find FBRequestConnection, one of its delegate method, + (FBRequestConnection*)startForUploadPhoto:(UIImage *)photo completionHandler:(FBRequestHandler)handler look into FBRequestHandler it will returns something that may useful to you.

Twitter,

See Integrating with Twitter on iOS

You need to see for SLRequest class, twitter api using this for connection to the service, read for SLRequestHandler one of its delegate, - (void)performRequestWithHandler:(SLRequestHandler)handler , it gives typedef void(^SLRequestHandler)(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error);

If you get success in achieving this, you can further more look this question to calculate percentage downloaded.

Community
  • 1
  • 1
Hemang
  • 26,840
  • 19
  • 119
  • 186