2015-09-26 151 views
0
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init]; 
content.contentURL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Facebook"]; 
NSURL *imageURL = 
[NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg"]; 

[email protected]"This is facebook test"; 
[email protected]"Hello"; 
content.imageURL=imageURL; 


FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init]; 
shareButton.shareContent = content; 
shareButton.center = self.view.center; 
[self.view addSubview:shareButton]; 

我用facebook-ios-sdk-3.24.0.pkg,我使用上面的代碼在facebook上使用fbsdksharekit進行鏈接共享。此代碼工作正常,但在關閉xcode並重新打開xcode6.0後,它顯示下面的錯誤。 FBSDKCoreKit/FBSDKCoreKit.hFBSDKShareKit/FBSDKShareKit.h找不到。如何使用FBSDKShareLink在Facebook上分享鏈接?

我導入這些框架,即FBSDKCoreKit/FBSDKCoreKit.hFBSDKShareKit/FBSDKShareKit.hviewcontroller.m文件。

可以任何一個告訴我什麼是問題。提前感謝。

+0

Facebook的IOS-SDK-3.24.0.pkg是它最新的SDK? –

+0

這是SDK 4.6版的下載鏈接https://origincache.facebook.com/developers/resources/?id=FacebookSDKs-iOS-20150910.zip –

+0

首先感謝您的回覆。 FacebookSDKs-iOS-20150910 ie 4.6.在這個SDK中,當我運行應用程序時,它顯示以下錯誤:146架構重複的符號架構i386 –

回答

2

使用下面的代碼,在Facebook上分享,下載最新的Facebook SDK

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init]; 
    content.contentURL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Facebook"]; 
    NSURL *imageURL = 
    [NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg"]; 
    [email protected]"This is facebook test"; 
    [email protected]"Hello"; 
    content.imageURL=imageURL; 
    [FBSDKShareDialog showFromViewController:self withContent:content delegate:nil]; 
+0

感謝您的回覆,如何使用fbsdk sharelink共享fb上的圖片和視頻 –

+0

請參閱鏈接:https://developers.facebook.com/docs/sharing/ios –

+0

你能舉個例子嗎 –

相關問題