Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are 3 options a user has when the wall post dialog is present. Skip, Publish &amp; Cancel (the little 'x' at on top right).. Here is what you can expect.</p> <p>These methods described below are part of the FBDialogDelegate Protocol.</p> <p>The dialog calls dialogCompleteWithUrl:method and then it calls the dialogDidComplete:method</p> <p><strong>SKIP</strong> - When the user taps Skip, the url that is passed to the dialogCompleteWithUrl:method is </p> <blockquote> <p><code>fbconnect://success</code></p> </blockquote> <p><strong>PUBLISH</strong> - When the user taps Publish, the url that is passed to the dialogCompleteWithUrl:method is </p> <blockquote> <p><code>fbconnect://success/?post_id=123456789_12345678912345678</code></p> </blockquote> <p>where "123456789_12345678912345678" is the post id unique to the user's post (meaning, this post_id is just an example). To better explain the post_id, the post_id parameter consists of userIdentifier and the postIdentifier.</p> <blockquote> <p><code>post_id=&lt;userIdentifier&gt;_&lt;postIdentifier&gt;</code></p> </blockquote> <p><strong>CANCEL</strong> - When the user taps on the Cancel the dialog calls the dialogCancelWithUrl:method, then the dialogCancel:method. I am not doing anything with this call in the example below.</p> <p>*Since I am not using the post_id for anything except to determine if one is present to validate the success of the post, below is an example of how to differentiate the two results. This is just an example, to assist you in seeing the results as described above. Feel free to add your rendition*</p> <pre><code>#pragma mark - #pragma mark - FBDialogDelegate - /* ====================================================================*/ /*** Called when the dialog succeeds with a returning url.*/ - (void)dialogCompleteWithUrl:(NSURL *)url { NSLog(@"Post Complete w/ URL"); NSLog(@"%@",[url absoluteString]); NSString *theURLString = [url absoluteString]; NSString *successString = @"fbconnect://success?post_id="; NSString *skipString = @"fbconnect://success"; NSString *subStringURL = nil; if ([theURLString length] &gt; [successString length]) { subStringURL = [[url absoluteString] substringToIndex:28]; NSLog(@"%@",subStringURL); } if ([subStringURL isEqualToString:successString] ) { UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:@"Wall Post Successful" message:@"" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [successAlert show]; [successAlert release]; } if ([theURLString isEqualToString:skipString]) { UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:@"Wall Post Skipped" message:@"" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [successAlert show]; [successAlert release]; } } /*** Called when the dialog succeeds and is about to be dismissed.*/ - (void)dialogDidComplete:(FBDialog *)dialog { NSLog(@"Post Complete"); } /*** Called when the dialog is cancelled and is about to be dismissed. */ - (void)dialogDidNotComplete:(FBDialog *)dialog { NSLog(@"Post Cancelled"); } /*** Called when the dialog get canceled by the user.*/ - (void)dialogDidNotCompleteWithUrl:(NSURL *)url { NSLog(@"Post Cancelled w/ URL"); NSLog(@"%@",[url absoluteString]); } </code></pre>
 

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