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":

  1. "https://www.codeproject.com/kb/gdi-plus/imageprocessing2/flip.jpg"

    • this worked - referencing url on web
  2. "/private/var/mobile/containers/data/application/9bff81e8-dfe4-41ef-b25c-a82c79cf1708/tmp/yellopost.jpeg"

    • using string posts data linkedin, except image
  3. "file:///private/var/mobile/containers/data/application/9bff81e8-dfe4-41ef-b25c-a82c79cf1708/tmp/yellopost.jpeg"

    • this fails
  4. "/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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -