gpt4 book ai didi

ios - FBConnect:如何显示标准 FB 对话框以发布图片和标题?

转载 作者:行者123 更新时间:2023-11-28 17:38:14 26 4
gpt4 key购买 nike

我可以通过这种方式将图片发布到 FaceBook,无需任何用户交互:

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
facebookMessageTextView.text, @"message",
imageToSend, @"source",
nil];

FBRequest *request = [facebook requestWithGraphPath:@"me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];

现在我想做的是显示一个标准的 FB 对话框,这样用户就可以修改标题,并可能决定发布到其他人的墙上,或者作为私有(private)消息发送。如(来自 iPhone Facebook 应用程序):

enter image description here

我不需要相机按钮,因为我传入的图像不会被替换。但我希望用户能够选择张贴到他们的墙上,另一个用户的墙上,更改标题和隐私。我该怎么做?我还可以选择将此图片作为私有(private)消息发送吗?

更新:我可以将已经上传到用户相册(通过上面的代码)的照片发送到他们 friend 的时间轴,使用这个:

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"http://www.bitsonthego.com", @"link",
[fbID objectForKey:@"id"], @"object_attachment",
@"my profile", @"name",
@"description", @"description",
@"name of the post", @"name",
@"caption of my post", @"caption",
facebookMessageTextView.text, @"message",
nil];

[facebook requestWithGraphPath:@"/{friend's id}/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

我似乎仍然无法在标准 Facebook UI 中使用对话框来指定 friend 的,看来我必须编写自己的 UI 才能做到这一点。或者?

最佳答案

通过具有 publish_stream 权限的 Facebook Graph API(fbconnect 的替代品),您只能将照片发布到用户的墙或用户的相册。

此外,API 不允许发送私有(private)消息。我不知道有任何 iOS 对话框可以帮助您执行此操作。

但是,您可能想看看在 Android 世界中称为 intents 的东西,您的应用会说我想让用户执行此操作,然后操作系统会为用户提供他们想要的程序选项如果有多个程序,请执行此操作。我在 iphone equivalent to android intents for opening other apps 上找到了这篇 S/O 文章.也许其中有些东西可以用于 iOS。

关于ios - FBConnect:如何显示标准 FB 对话框以发布图片和标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9139926/

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