hi everyone . i implement FBConnect for my app via UIActionSheet with 2buttons .
my buttons are "Share On Facebook" and "Log out from facebook" . so i want when user click on share on facebook button FBLoginDialog
shows and user log in to facebook with his account and then show FBStreamDial
appears and user share something on his wall . and never show FBLoginDialog
again . it means just one time . and when user going to log out that method repeat again .
How can mange it ?
if i use this method : 2 method appear together !
-(void)actionSheet:(UIActionSheet *)menu didDismissWithButtonIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:
///SHOW LOGIN WINDOW
NSLog(@"asdasda");
FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:session] autorelease];
[dialog show];
///SHOW FBStreamDialog
FBStreamDialog* dialog2 = [[[FBStreamDialog alloc] init] autorelease];
dialog2.delegate = self;
dialog2.userMessagePrompt = @"Share Ghazals on your wall";
dialog2.attachment = @"{\"name\":\"Hafez Application for iPhone\","
"\"href\":\"http://itunes.apple.com/us/app/divan-of-hafez/id340865571?mt=8?tab=iphone\","
"\"media\":[{\"type\":\"image\","
"\"src\":\"http://momeks.com/images/fb.png\","
"\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],"
"\"properties\":{\"another link\":{\"text\":\"Hafez App HomePage\",\"href\":\"http://www.momeks.com/hafez\"}}}";
//replace this with a friends UID
//dialog2.targetId = @"999999";
[dialog2 show];
break;
case 2:
[session logout];
break;
}
}