2009-12-06 3 views
1

Lorsque l'utilisateur appuie sur le bouton Annuler dans FBStreamDialog, qui hérite de FBDialog, j'ai du mal à le différencier de l'utilisateur qui clique sur le bouton Publier. Semble que le rappel FBDialog dismissWithSuccess est toujours passé avec le statut: NON, quel que soit le bouton sur lequel vous avez cliqué. Qu'est-ce que je fais mal? Merci!FBDialog annuler le rappel du bouton

Voici la classe qui gère toutes les FBConnect dans mon application:

@interface SocialMediaViewController : UIViewController <FBSessionDelegate, FBRequestDelegate, FBDialogDelegate> {... 

Voilà comment j'instancié la connexion.

FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:self.fbSession] autorelease]; 
dialog.delegate = self; 
[dialog show]; 

Voici comment j'ai instancié le FBStreamDialog.

FBStreamDialog* dialog = [[FBStreamDialog alloc] init]; 
dialog.delegate = self; 
dialog.userMessagePrompt = @"Enter additional comment:"; 
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"My name string %@\"," "\"href\":\"http://xyz.com/\"," "\"caption\":\"placeholder-%@\",\"description\":\"%@\"," "\"properties\":{\"More like this\":{\"text\":\"XYZ website\",\"href\":\"http://XYZ.com/\"}}}", self.curReview.businessName, self.curReview.reviewType, self.curReview.reviewDetail]; 
[dialog show]; 

Répondre

5

Ajouter ce qui suit comme la première ligne FBDialog.m/webViewDidFinishLoad:

[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick = function onclick(event) { window.location.href = 'fbconnect:cancel'; }"]; 

Gardez à l'esprit que Facebook ne vous permet pas aux utilisateurs "punissez" pour annuler :-)

Questions connexes