简体   繁体   English

Parse.com - 如何在PFObject上跟踪操作并更新当前的PFUser

[英]Parse.com - How to keep track action on PFObject and update current PFUser

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. 假设我有一个类名:带有像objectId,songName,thumbnailData,mp3Data等列的歌曲。

and I have a User class which is getting filled by normal sigup/facebook or twitter authentication process. 我有一个User类,它正在通过正常的sigup / facebook或twitter认证过程填充。

In my Song class I have plenty of data. 在我的Song课程中,我有大量的数据。 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 ? 我是否需要在User类中添加另一列,如“purchase”(类型:数组),并继续使用歌曲的对象ID数组更新该列? 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. 这样我就可以在MyPlaylist部分显示所有这些歌曲了。

Have a look at the Anypic tutorial app and see how they use the Activity class. 看看Anypic教程应用程序,看看他们如何使用Activity类。 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. Activity类跟踪喜欢的内容,喜欢谁以及拥有喜欢的照片的人。 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 https://parse.com/tutorials/anypic

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM