Note that there are some explanatory texts on larger screens.

plurals
  1. POParse Facebook Dialog Delegate methods not being called
    primarykey
    data
    text
    <p>I'm using the Parse SDK to implement a Facebook <code>apprequests</code> dialog in my app. For all intents and purposes it just wraps the Facebook SDK, prefixing Facebook methods with <code>PF_</code>.</p> <p>I use this code to prepare and raise the dialog:</p> <pre><code>NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat:@"I just challenged you to a game!"], @"message", [friendIds componentsJoinedByString:@"," ], @"to", nil]; PF_FBSession *session = [PFFacebookUtils session]; PF_Facebook *facebook = [[PF_Facebook alloc] initWithAppId:session.appID andDelegate:nil]; facebook.accessToken = session.accessToken; facebook.expirationDate = session.expirationDate; [facebook dialog:@"apprequests" andParams:params andDelegate:self]; </code></pre> <p>This works well, I'm getting the dialog, I'm able to invite friends to play with the app.</p> <p>The problem is that the delegate methods are not being called, even though I've set the view controller as a <code>PF_FBDialogDelegate</code>:</p> <pre><code>@interface ChallengeFriendsViewController : UIViewController &lt;UITableViewDelegate, PF_FBDialogDelegate&gt; { NSArray *facebookFriends; NSMutableArray *selectedFriends; } </code></pre> <p>These are some of the delegate methods I'm talking about: </p> <pre><code>- (void)dialog:(PF_FBDialog *)dialog didFailWithError:(NSError *)error { NSLog(@"Error in Dialog: %@", error); } - (void)dialogDidNotCompleteWithUrl:(NSURL *)url { NSLog(@"Failure on Facebook server side"); } - (void)dialogCompleteWithUrl:(NSURL *)url { NSLog(@"Did complete with URL"); [self.navigationController popViewControllerAnimated:YES]; [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; } - (void)dialogDidNotComplete:(PF_FBDialog *)dialog { NSLog(@"Cancelled"); [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; } </code></pre> <p>Without these methods being called I'm really not able to handle the sharing in an intuitive way. I'm stumped as to why they wouldn't be called and feel I've tried everything. Any pointers to where I'm going wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload