gpt4 book ai didi

ios 快速将图像发布到 linkedin

转载 作者:行者123 更新时间:2023-11-30 12:13:46 24 4
gpt4 key购买 nike

我正在使用 Swift 3 和 LinkedIn API 将图像发布到 LinkedIn。

当我通过 http URL 发布图像时,该代码有效。但是,当我使用包含 iPhone 上本地文件路径的 URL、NSURL 或字符串时,图像不会传输。

以下是表示正在传递的数据的代码:

let parameters: Parameters = [
"content": [
"title": "Title",
"description": "Description",
"submitted-url": "https://www.google.com",
"submitted-image-url": --- This parameter is the problem --
],
"comment": "comment",
"visibility": [
"code": "anyone"
]
]

以下是我用于“subscribed-image-url”的值:

  1. "https://www.codeproject.com/KB/GDI-plus/ImageProcessing2/flip.jpg "

    • 这有效 - 引用网络上的 URL
  2. “/private/var/mobile/Containers/Data/Application/9BFF81E8-DFE4-41EF-B25C-A82C79CF1708/tmp/yellopost.jpeg”

    • 使用它作为字符串将所有数据发布到 LinkedIn(图像除外)
  3. “文件:///private/var/mobile/Containers/Data/Application/9BFF81E8-DFE4-41EF-B25C-A82C79CF1708/tmp/yellopost.jpeg”

    • 失败了
  4. “/private/var/mobile/Containers/Data/Application/9BFF81E8-DFE4-41EF-B25C-A82C79CF1708/tmp/yellopost.jpeg”作为 NSURL

    • 失败了

那么,如何引用 iPhone 上存储的图像?

提前致谢。

最佳答案

API 仅接受远程 URL。否则后端如何访问图像?

例如:

{
"comment": "Check out developer.linkedin.com!",
"content": {
"title": "LinkedIn Developers Resources",
"description": "Leverage LinkedIn's APIs to maximize engagement",
"submitted-url": "https://developer.linkedin.com",
"submitted-image-url": "https://example.com/logo.png"
},
"visibility": {
"code": "anyone"
}
}

关于ios 快速将图像发布到 linkedin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45685512/

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