2015-09-26 155 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

你能举个例子吗 –

相关问题