문제

Proper content management system using data browser for below scenario:

Lets say I have a class name: Song with columns like objectId, songName, thumbnailData, mp3Data etc.

and I have a User class which is getting filled by normal sigup/facebook or twitter authentication process.

In my Song class I have plenty of data. So the issue is how I can link song with user ? For all loggedin user there will be list of common songs and a download/purchase button. So if any user click download/purchase button then for that user app will never ask to purchase again. It will say like already purchased. Do I need to add another column in User class like "purchased" (type: array) and keep updating that column with array of song's object ids ? Can't think of any other better solution. Any recommended approach to keep track of downloaded songs for the current user ? So that I can show all such songs in MyPlaylist section.

도움이 되었습니까?

해결책

Have a look at the Anypic tutorial app and see how they use the Activity class. I think you could use this concept to track purchases.

Basically, they use a separate class to track when users like photos. The Activity class tracks what is liked, who is liking and who owns the photo that was liked. A class like this could track any info you need, like purchase price, purchase time etc.

Also, see how they do caching for a more snappy user experience.

https://parse.com/tutorials/anypic

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top