2

こんにちは、Xib ファイルの Xcode 4.6 のアプリで同様の機能を使用していますが、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];
}
4

1 に答える 1