How do I get the creator information in the kiney backend?
started a topic
over 7 years ago
So I need to see in my class's the object id of who created the object. I see that there is some meta data on this automaticly stored by kinvey. How do I access this information? Here is the documentation that details what I am talking about but it does not give an example of how to access it. I need to be able ot access it in java, android and iOS please.
You can optionally have the library supply metadata information by mapping a KCSMetadata-value property to the KCSEntityKeyMetadata key.
KCSMetadata provides meta-information about the entity:
lastModifiedTime the time the entity was last updated on the server
creatorId the id of the user that first created the object.
There are also additional fields to control read and write permissions of the object; these are covered in the Security guide.
If anyone could help with this I would appreciate it.
http://devcenter.kinvey.com/ios/guides/datastore#EventandInvitationExample provides an example of how to get the entity metadata - see the header file and the implementation. After the fetch, the property metadata will contain fields for lastModifiedTIme and creatorId. The library won't automatically fetch the whole user with id equal to creatorId, you would have to fetch it. Keep in mind that depending on permissions on the user collection, the requesting user may not have accesses to the entity representing the creator.
about 7 years ago
Thanks for the answer! This is what I needed but I am just now getting to it. I asked it before I needed it haha.