gpt4 book ai didi

iOS、Facebook、GraphAPI 问题

转载 作者:行者123 更新时间:2023-11-28 21:27:10 24 4
gpt4 key购买 nike

我需要允许用户从 iOS 应用程序在 Facebook 上发布信息,以下几乎是我想要的,但是:

  1. 我显然不想要 ISBN,因为应用程序中的信息(实际上是另一个用户的帖子)不是可以描述为“书”并且没有 ISBN 的信息
  2. 我需要以某种方式附上应用程序的 Logo 。现在它仅显示为脚注。我只能附上一张图片,但需要第二张图片,即 Logo 。

任何人都可以建议我应该使用什么其他模式,如果不是可以正确表达意义的“books.book”:“用户 A 阅读(或喜欢)用户 B 的帖子”。

这就是 FB 帖子现在的样子:

enter image description here

我为此使用的代码如下:

NSString *title = self.currSelecectedContextCell.uploaderDemoLabel.text;
NSURL *imageURL = self.currSelecectedContextCell.upload.screenshotURL;
NSString *description = self.currSelecectedContextCell.contextLabel.text;
NSDictionary *properties = @{
@"og:type": @"books.book",
@"og:title": title,
@"og:image": imageURL,
@"og:description": description,
@"books:isbn": @"0-553-57340-3",
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

// Create an action
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"books.reads";
[action setObject:object forKey:@"books:book"];

FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"books:book";

[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:nil];

最佳答案

通过以下方式解决:

NSString *title = self.currSelecectedContextCell.uploaderDemoLabel.text;
NSURL *imageURL = self.currSelecectedContextCell.upload.screenshotURL;
NSString *description = self.currSelecectedContextCell.contextLabel.text;
NSDictionary *properties = @{
@"og:type": @"object",
@"og:url":@"http://www.textpertapp.co/",
@"og:title": title,
@"og:image": imageURL,
@"og:description": description
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

// Create an action
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"og.likes";
[action setObject:object forKey:@"object"];

FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"object";

[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:nil];

关于iOS、Facebook、GraphAPI 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37648261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com