Start a new topic

Custom Endpoint result translated to Kinvey iOS entity

I have a custom endpoint that returns a set of entities. But, when I get the result on iOS, that returned entities comes as NSDictionary. So, what is the best way to translate these dictionaries into native Kinvey Objects?

There is not, because you still have to figure out what your objects are. If you've done all the work of figuring out what objects go to what collection, you should already have the properties, and then you can just iterate over all the keys of the return dictionary.
Actually, what I need is a custom endpoint because it's a routine that request different collections and depends on params sent by the app. I know that internally, Kinvey makes this kind of translation, getting json dictionaries from server and converting them to instance models. Can I use some private method by making it public or something? I really don't want to write all that converting process. Thanks
Custom endpoints aren't meant to for entities. Can you use collection hook business logic to preform the same logic? Otherwise you can can just `setXXX:` for each of the properties you want to set, based upon the dictionary return values.
Login or Signup to post a comment