Start a new topic

Offline Data | Public Images

I am developing a timeline of user activities pretty much like Facebook.

Some of these activities contain images that must be viewable by other users too and available for offline use.

To give you a heads up on my model let's get back to the Fruit example.

___________________________________________________________________

I own a grocery store where we sell Fruits.

Fruits have a title {"Apple","Pair","Banana",...} and an image.

Fruits and their images are NOT created by Users.

They are created by the owner of the Grocery Store.



Users can post their Activities with Fruits.

Activities have a title {"Bought","Ate","Sold"} and a related Fruit.



Posted activity looks like:

"User [A/B/C] , [Bought/Ate/Sold] a [Banana/Pair/Apple] and it was awesome" + image of Fruit



___________________________________________________________________

How should I build that in order to make images available for offline use?

What should my activityObject look like and what should my Cache policy be?



Guides and Example Apps were not that helpful on this one.

Thanks a lot in advance!

Guys....some help?

Hey Arris, Our iOS dev is at a conference this week, sorry about the delay!
Does that mean that there will be no support until the end of the week?
You can make a file publicly accessible by specifying the `KCSFilePublic` option when uploading: http://devcenter.kinvey.com/ios/guides/files#UploadOptions. On the client side, after a file is downloaded, you can move it from its temporary location to a different folder to retrieve later.
Thanks, I get what you're saying.I was already halfway with the public file.

How should I set the public KCSFile as a Reference on the Fruit Object so that it is downloaded whenever I fetch the Fruit?

We don't yet support setting the metadata flags with references. You can either make the file public with a separate call to the REST API and use the library with linked files, or you can use the `KCSFileStore` api to upload/download files and just have a manual reference in the object. That is instead of having a file ref, just use the file id as a property. Then when you download the object, request the file separately.
> @Mike said:

> You can make a file publicly accessible by specifying the `KCSFilePublic` option when uploading: http://devcenter.kinvey.com/ios/guides/files#UploadOptions. On the client side, after a file is downloaded, you can move it from its temporary location to a different folder to retrieve later.



How to set an image as public when uploading it using KCSLinkedAppdataStore?
Login or Signup to post a comment