Adding date and image fields in PodioKit for Objective-C (iOS)

Comments

5 comments

  • Official comment
    Sebastian Rehnby

    Hi Jonathan!

    Great to see you trying out the new version of PodioKit. As we are still developing it and improving it on a daily basis, I would suggest you to point directly to the Github repo by using this line in your Podfile:

    pod 'PodioKit', :git => "https://github.com/podio/podio-objc.git"

    To answer your question, I've updated the README in the Github repository to describe the acceptable values for the various field types.

    Basically, if you have an image field, just set the value to be the PKTFile object you get back from the upload operation. For dates, use an instance of the PKTDateRange class. This means you don't have to use the file ids directly to set field values. PodioKit will figure it out from the PKTFile object. I will also add a bit more detail to the exception message, as it is quite unclear right now.

    Let us know if you run into any other bugs or issues.

    Comment actions Permalink
  • Jonathan Sala

    Hi Sebastian! Thanks heaps for that, I'll give it a go and report back :).

    I've updated the Podfile too, I'm guessing I'll need to run pod update it every so often? Or does CocoaPods keep it updated automatically?

    0
    Comment actions Permalink
  • Jonathan Sala

    So I'm passing in the file returned from uploadWithData:fileName:mimeType:completion: and it's giving me that Bad Request 400 error I mentioned in my original question. Any idea why this is happening? The file is coming straight out of the upload function, I haven't changed anything about it.

    0
    Comment actions Permalink
  • Sebastian Rehnby

    After updating the Podfile, you need to run "pod install" to fetch the latest version of PodioKit. Try that and if it still gives you an error, let me know.

    Is the field in question an image field?

    0
    Comment actions Permalink
  • Jonathan Sala

    The field was indeed an image, and I realised the problem after playing with the new expenses example app - I hadn't included ".png" at the end of the file name! That was the cause of the 400 error. Thanks for the help!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk