0
我实现FBConnect为我的应用程序通过UIActionSheet 2buttons。UIActionSheet问题与FBConncet {iPhone SDK}
我的按钮是“在Facebook上共享”和“从Facebook注销”。所以我想当用户点击facebook上的分享按钮FBLoginDialog
显示和用户使用他的帐户登录Facebook时,然后显示FBStreamDial
出现,用户在他的墙上分享一些东西。再也不会显示FBLoginDialog
。这意味着只有一次。并且当用户注销该方法时再次重复。 如何管理它?
如果我使用这种方法:2方法一起出现!
-(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;
}
}