2012-08-27 141 views

回答

1

我想這也許代碼的工作,沒有工作。

NSMutableDictionary *params; 
params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           userID, @"to", 
           msg,@"message", 
           theUrl, @"picture", 
           appLink, @"link", 
           nil]; 

[facebook_ dialog:@"feed" 
     andParams:params 
     andDelegate:self]; 
+0

facebook_不是訪問可以在FB sdk 3.0中使用。我有這個[FBRequestConnection startForPostStatusUpdate:message completionHandler:^(FBRequestConnection * connection,id result,NSError * error){ [self showAlert:message result:result error:error]; self.buttonPostStatus.enabled = YES; }]; –

0
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
             @"facebook key", @"app_id", 

             @"http://developers.facebook.com/docs/reference/dialogs/", @"link", 
             @"image link", @"picture", 
             @" ", @"description", 
             @"", @"name", 
             @" ", @"caption", 
             nil]; 


     [_facebook dialog:@"feed" andParams:params andDelegate:self]; 

     [_facebook logout]; 

你沒有必要給Facebook authentication.if你是不是比首秀登錄屏幕,比戲份對話框登錄。 Also refer

+0

它不適合我我正在使用新的SDK。它沒有Facebook類。 –

1

https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/

您需要將棄用頭導入到項目中。它們位於Documents/FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders中。一旦你導入所有這些文件,你可以創建一個Facebook對象,並做其他答案所說的。 FB 3.0 SDK不適用於任何使用FBDialog的舊功能(發送應用程序請求,發佈到牆上等)。

0

對於Facebook而言SDK 3.0:

我使用以下FBRequestConnection塊一起分享我的Facebook上的朋友牆我的應用程序給定facebookid的方法parameter.IF你想在你自己與他人分享同樣的事情剛改變

[NSString stringWithFormat:@"%@/feed",friendId] 

@"me/feed" 
-(void)postToFriendWall:(NSString*)friendId{ 

NSString *pictureUrl = [NSString stringWithFormat:@"http://......."]; 


NSMutableDictionary *postParams = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
            @"Name", @"name", 
            @"www.mylink.com", @"link", 
            @"Caption Text", @"caption", 
            @"Description Text", @"description", 
            @"Post Message", @"message", 
            pictureUrl, @"picture", 
            nil]; 

[FBRequestConnection 
startWithGraphPath:[NSString stringWithFormat:@"%@/feed",friendId] 
parameters:postParams 
HTTPMethod:@"POST" 
completionHandler:^(FBRequestConnection *connection, 
        id result, 
        NSError *error) { 

    if (!error) { 

     UIAlertView *postSentAlert = [[UIAlertView alloc] initWithTitle:@"Facebook" 
                   message:NSLocalizedStringFromTable(@"kFacebookPostAlertTitle", @"ContactList", "") 
                   delegate:nil 
                 cancelButtonTitle:NSLocalizedStringFromTable(@"kOK", @"ApplicationStrings", "") 
                 otherButtonTitles:nil]; 

     [postSentAlert show]; 

    } 
} 
相關問題