gpt4 book ai didi

xcode - FBSDKGraphRequest 不能再发布图像和文本(不再有文本)

转载 作者:行者123 更新时间:2023-12-01 03:34:23 26 4
gpt4 key购买 nike

我正在向群组用户墙发帖(图片和文字)。它已经工作了很长时间,最近停止工作(现在,图像已发布,但没有文字:()。知道是否有新的方法或规则?(没有错误报告)

    [params setObject:sContent forKey:@"message"];
[params setObject:yourImageData forKey:@"picture"];



[[[FBSDKGraphRequest alloc]
initWithGraphPath:@"xxxxxxxxxxxxxxx/photos"
parameters: params
HTTPMethod:@"POST"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {

最佳答案

以下是我的工作代码(在 Swift 中):

let params = ["message": "Test message", "sourceImage" : UIImagePNGRepresentation(UIImage(named: "test.jpg")!)!]
FBSDKGraphRequest(graphPath: "me/photos", parameters: params, HTTPMethod: "POST").startWithCompletionHandler({ (connection, result, error) -> Void in
guard let response = result else {
print("No response received")
if let errorInfo = error {
print("errorInfo: \(errorInfo)")
}
return }

print(response)
})

link 检查“发布”部分更多。

如果您在将其转换为 Objective-C 时遇到任何困难,请告诉我。

关于xcode - FBSDKGraphRequest 不能再发布图像和文本(不再有文本),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35977834/

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