我正在尝试使用FBSDKShareDialog将图片网址发布到Facebook。图像网址具有https,并使用自签名证书。但https图片网址在发布到Facebook之前和之后都没有呈现。以下是我在Facebook上分享的代码:
NSURL *imageURL = [NSURL URLWithString:url];
FBSDKSharePhoto *photo = [FBSDKSharePhoto photoWithImageURL:imageURL userGenerated:NO];
// Create an object
NSDictionary *properties = @{
@"og:type": @"fit:class",
@"og:title": sliceClass.className,
@"og:description": desc,
@"og:url": myURL,
@"og:image": @[photo]
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
// Create an action
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"fit:book";
[action setObject:object forKey:@"fit:class"];
// Create the content
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"fit:class";
[[FBSDKShareAPI shareWithContent:content delegate:nil] share];
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.fromViewController = vc;
shareDialog.shareContent = content;
[shareDialog setShareContent:content];
[shareDialog setFromViewController:vc];
[shareDialog show];
非常感谢任何帮助。