Guest User

Untitled

a guest
Oct 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. - (void)submitLikeForProductIdString:(NSString *)productId
  2. andFacebookUserString:(NSString *)facebookUser
  3. withDelegate:(id<TMAPIDataConsumer>)delegate
  4. {
  5. __weak TMAPI *blockSelf = self;
  6. __weak id<TMAPIDataConsumer> blockDelegate = delegate;
  7.  
  8. TMAPISuccessCallback success = ^(AFHTTPRequestOperation *operation, id responseObject) {
  9. if([blockDelegate respondsToSelector:@selector(TMAPI:didSubmitLikeForProductIdString:andFacebookUserString:)])
  10. {
  11. [blockDelegate TMAPI:blockSelf didSubmitLikeForProductIdString:productId andFacebookUserString:facebookUser];
  12. }
  13. };
  14.  
  15. TMAPIFailureCallback failure = ^(AFHTTPRequestOperation *operation, NSError *error) {
  16. [blockDelegate requestDidFailFromTMAPI:blockSelf];
  17. };
  18.  
  19.  
  20.  
  21. [self postPath:[NSString stringWithFormat:@"products/%@/like.json",productId]
  22. parameters:[NSDictionary dictionaryWithObject:facebookUser forKey:@"fb_token"]
  23. success:success
  24. failure:failure];
  25. }
Add Comment
Please, Sign In to add comment