[英]share post on linkedin using ios swift 3 and linkedin sdk is not working
[英]ios swift post image to linkedin
我正在使用Swift 3和LinkedIn API將圖像發布到LinkedIn。
當我通過http URL發布圖像時,該代碼有效。 但是,當我使用包含iPhone上本地文件路徑的URL,NSURL或String時,不會傳輸圖像。
這是代表要傳遞的數據的代碼:
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"
]
]
這是我用於“ submitted-image-url”的值:
“ https://www.codeproject.com/KB/GDI-plus/ImageProcessing2/flip.jpg ”
“/private/var/mobile/Containers/Data/Application/9BFF81E8-DFE4-41EF-B25C-A82C79CF1708/tmp/yellopost.jpeg”
“文件:///private/var/mobile/Containers/Data/Application/9BFF81E8-DFE4-41EF-B25C-A82C79CF1708/tmp/yellopost.jpeg”
“ / private / var / mobile /容器/數據/應用程序/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"
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.