下载最新的Facebook,并遵循以下文档:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://developers.facebook.com"];
[FBSDKShareDialog shareFromViewController:self
withContent:content
delegate:nil];但是有一个问题,没有shareFromViewController方法!只有showFromViewController方法,它不能做共享工作,共享方法在哪里?
发布于 2015-05-13 08:04:46
SDK中没有用于共享的shareFromViewController方法,而是用于共享的showFromViewController方法。
[FBSDKShareDialog showFromViewController:self
withContent:tempContent
delegate:self];或
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.delegate=self;
shareDialog.fromViewController = self;
shareDialog.shareContent = content;
[shareDialog show];//代表方法
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results{
}
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer{
}
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error{
NSLog(@"%@",error);
}https://stackoverflow.com/questions/30208665
复制相似问题