我想使用新的iOS 4.0 SDK在Facebook上顯式共享開放圖形動作。以下不起作用。它顯示在我的活動日誌上,但不在我的時間軸上。在Facebook上進行顯式共享iOS SDK 4.0
// Construct an FBSDKSharePhoto
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = img;
photo.userGenerated = YES;
// Create an object
NSDictionary *properties = @{
@"og:type": @"theprose:post",
@"og:title": post.title,
@"og:description": post.text,
@"og:caption": @"A fresh picked Prose for you.",
@"og:url": post.url,
@"fb:explicitly_shared": @"true"
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
// Create an action
FBSDKShareOpenGraphAction *act = [[FBSDKShareOpenGraphAction alloc] init];
act.actionType = @"theprose:share";
[act setObject:object forKey:@"theprose:post"];
[act setPhoto:photo forKey:@"image"];
// Create the content
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = act;
content.previewPropertyName = @"theprose:post";
[[FBSDKShareAPI shareWithContent:content delegate:nil] share];
你有沒有解決過這個問題?我遇到了同樣的問題。 – sak
我在swift 3有同樣的問題..你能在這裏發佈最新的代碼嗎? – Jan