views:

480

answers:

5

Hey.

I use FBStreamDialog to let users publish on their news feed.

[fbStreamDialog show];

makes the dialog view popup, the user can press cancel or submit that message.

Now...my problem is that both buttons close the dialog view and call the delegate method dialogDidSucceed.

How do I find out which button was pressed? Its very important for me to know, any useful advice would be reaally really nice!

Thanks, John

A: 

Im having the same problem here, there is no other information provided that tells me which button was pressed.

stevie
+1  A: 

there should be button index so that you can recognize which button was pressed.

Rahul Vyas
how do i access that button index ?this is the delegate method i have to use:-(void)dialogDidSucceed:(FBDialog*)dialog it doesnt provide a button index :-(
JohnPayne
please post complete code or send source code this is my mail id [email protected]
Rahul Vyas
why??? if you have never seen a facebook dialog view then you cannot help - if yes, the view contains two buttons, cancel + publish. how do you find out which button was pressed??
JohnPayne
A: 

I asked the facebook connect developer team and got the following answer:

We don't currently reveal what button the user clicked in order to avoid incentivization of publishing actions. The DidSucceed just lets you know the dialog was run properly, and FB will publish or not publish the story appropriately.

JohnPayne
+5  A: 

ok... didnt want to give up. just in case somebody else gets the same problem..

if you do not mind making a slight modification to the fbconnect original code - open FBDialog.m and add the following line to -(void)webViewDidFinishLoad...

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

this will call the dialogDidCancel delegate method instead the dialogDidSucceed.

cheers.

JohnPayne
This is very useful, thank you.
Gordon Christie
A: 

John, I'm having the same problem and implemented your suggestion to the fbdialog.m file -- It has not solved my problem. When the user presses 'cancel' the 'didsucceed' routine is still being called.

Miriam Raphael Roberts
Ok - works now. The problem was that the 'dialogDidCancel' routine was missing from my class file. After that was added the hack worked. Thank you.
Miriam Raphael Roberts
Anytime Miriam. :)
JohnPayne