ios swift post image to linkedin -
i using swift 3 , linkedin apis post image linkedin.
the code works when post image via http url. but, image not transferred when use url, nsurl, or string contains path local file on iphone.
here code represents data being passed:
let parameters: parameters = [ "content": [ "title": "title", "description": "description", "submitted-url": "https://www.google.com", "submitted-image-url": --- parameter problem -- ], "comment": "comment", "visibility": [ "code": "anyone" ] ]
here values have used "submitted-image-url":
"https://www.codeproject.com/kb/gdi-plus/imageprocessing2/flip.jpg"
- this worked - referencing url on web
"/private/var/mobile/containers/data/application/9bff81e8-dfe4-41ef-b25c-a82c79cf1708/tmp/yellopost.jpeg"
- using string posts data linkedin, except image
"file:///private/var/mobile/containers/data/application/9bff81e8-dfe4-41ef-b25c-a82c79cf1708/tmp/yellopost.jpeg"
- this fails
"/private/var/mobile/containers/data/application/9bff81e8-dfe4-41ef-b25c-a82c79cf1708/tmp/yellopost.jpeg" nsurl
- this fails
so, how reference image stored on iphone?
thanks in advance.
the api accepts remote urls. how backend access image otherwise ?
e.g:
{ "comment": "check out developer.linkedin.com!", "content": { "title": "linkedin developers resources", "description": "leverage linkedin's apis maximize engagement", "submitted-url": "https://developer.linkedin.com", "submitted-image-url": "https://example.com/logo.png" }, "visibility": { "code": "anyone" } }
Comments
Post a Comment