2013-06-05 2 views
0

Alrighty. 버튼 (아래)은 앱에서 정보를 가져 와서 사용자 FB 피드에 게시합니다.iOS 인증 후 Facebook 게시판 게시 화면이 표시되지 않습니다.

거의 작동하지 않습니다. 그것들은 보통 그 후 꽤 잘 작동 할 것입니다. 무슨 일이 일어나는가, 버튼을 누를 때 앱에 이미 FB 사용 권한이 부여되었다는 것을 알 수 있습니다. FB는 매번 처음이 아니라 처음 만보고 싶을뿐입니다. 그런 다음 거기에서 OK를 누르면 응용 프로그램으로 돌아가거나 내 벽에 실제로 게시 할 수있는 페이지를 표시합니다 (원하는 내용).

나는 이것을 좀더 일관되게하기 위해 다른 것을 시도하고 있습니다. 이 문제를 일으킬만한 것이 있습니까? 1) SBJson의 복사본을 업그레이드하십시오 : 문 내 문제를 해결할 것으로 보인다 경우

-(IBAction)fbButton:(id)sender { 

    if (![facebook isSessionValid]) { 
     [facebook authorize:permissions]; 
     [permissions release]; 
    } 

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
    if ([defaults objectForKey:@"FBAccessTokenKey"] 
     && [defaults objectForKey:@"FBExpirationDateKey"]) { 
     facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"]; 
     facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"]; 
    } 

    //Post to Wall 

    NSString *poopDollas = [[NSString alloc] initWithFormat: 
         @"sometext $%@!",dollas.text]; 

    SBJSON *jsonWriter = [[SBJSON new] autorelease]; 

    // The action links to be shown with the post in the feed 
    NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
                 @"Get Started",@"name",@"http://www.facebook.com/pages/xx/204640386498567",@"link", nil], nil]; 
    NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; 
    // Dialog parameters 
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
            @"DM", @"name", 
            poopDollas, @"caption", 
            @"sometext", @"description", 
            @"http://www.facebook.com/pages/xx/204640386498567", @"link", 
            @"http://farm8.staticflickr.com/7185/6999841878_e66a8e00fc_t.jpg", @"picture", 
            actionLinksStr, @"actions", 
            nil]; 

    FBDialog *delegate = (FBDialog *)[UIApplication sharedApplication].delegate; 

    [facebook dialog:@"feed" andParams:params andDelegate:(id <FBDialogDelegate>)delegate]; 
} 
+0

코멘트가 몇 첫 번째에서

[facebook authorize:permissions]; [permissions release]; 

을했다. 사용하고있는 수업은 2 년 전으로 나뉘 었습니다. 많은, * 많은 * 중요한 버그가 수정되었습니다. 2) ARC를 사용하려면 코드를 업그레이드하십시오. 3) 가독성을 위해 사전 정적 초기화기를 사용하십시오 ('@ {@ "키": @ "값"} "). –

답변

0

나는 ..