这可能是一个愚蠢的问题,但我无法弄清楚在哪里添加fb:explicitly_shared bool。
当使用Graph API Explorer时,我能够使其正常工作,只需添加字段并将其设置为“true”。非常好用。
但是当我尝试从我的iOS应用程序中执行此操作时,它根本不起作用。
- (id<OGObject>)myObjectForObject:(NSDictionary*)object
{
NSString *format =
@"http://www.myurl.com/fbobjects/object.php?"
@"fb:app_id=<my_app_id>&og:type=%@"
@"&fb:explicitly_shared=true"
@"&og:title=%@"
@"&og:description=%@"
@"&og:image=http://www.myimageurl.com/image.png"
@"&body=%@";
id<OGObject> result = (id<OGObject>)[FBGraphObject graphObject];
// Give it a URL that will echo back the name of the wod as its title,
// description, and body.
result.url = [NSString stringWithFormat:format,
@"myapp_namespace:object",
[object objectForKey:@"title"],
[object objectForKey:@"description"],
[object objectForKey:@"title"]];
NSLog(@"%@", result.url);
return result;
}
这段内容主要来自于开放图谱教程,链接在此:https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/#step7,只有当我添加了fb:explicitly_shared时才不同。
从iOS设备发布时需要在哪里添加这个呢?非常感谢您的帮助 :)