2
嗨,我在Xib 4.6在Xib文件中的應用程序中使用像我的應用程序中的功能,但點擊Facebook是不是登錄。而另一方面,當我在故事板中的另一個應用程序中進行登錄時,則是登錄。如果有人知道,請指導我。Facebook是不是在我的應用程序登錄
- (id)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
_facebook = [[Facebook alloc] initWithAppId:@"129649123867187" andDelegate:self];
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.facebookLikeView.href = [NSURL URLWithString:@"http://sis.uol.edu.pk/sis/MainForms/login.aspx"];
self.facebookLikeView.layout = @"button_count";
self.facebookLikeView.showFaces = NO;
// self.facebookLikeView.alpha = 1;
[self.facebookLikeView load];
facebookLikeView.delegate = self;
}
#pragma mark FBSessionDelegate methods
- (void)fbDidLogin {
self.facebookLikeView.alpha = 1;
[self.facebookLikeView load];
}
- (void)fbDidLogout {
self.facebookLikeView.alpha = 1;
[self.facebookLikeView load];
}
#pragma mark FacebookLikeViewDelegate methods
- (void)facebookLikeViewRequiresLogin:(FacebookLikeView *)aFacebookLikeView {
[_facebook authorize:[NSArray array]];
}
- (void)facebookLikeViewDidRender:(FacebookLikeView *)aFacebookLikeView {
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDelay:0.5];
self.facebookLikeView.alpha = 1;
[UIView commitAnimations];
}
- (void)facebookLikeViewDidLike:(FacebookLikeView *)aFacebookLikeView {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Liked"
message:@"You liked my app. Thanks!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil] ;
[alert show];
}
- (void)facebookLikeViewDidUnlike:(FacebookLikeView *)aFacebookLikeView {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Unliked"
message:@"You unliked my app ."
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil] ;
[alert show];
}
請張貼一些代碼.... – 2013-03-04 09:34:42
知道你可以看到它 – 2013-03-04 09:44:07
你檢查FBSession.activeSession.isOpen fbuser是否登錄 – 2013-03-04 09:53:36