As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Custom Endpoint result translated to Kinvey iOS entity
N
Neto Leal
started a topic
about 10 years ago
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.
N
Neto Leal
said
about 10 years ago
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
M
Mike
said
about 10 years ago
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.
Neto Leal