简体   繁体   English

将ParseObject链接到Facebook用户

[英]Link ParseObject to Facebook user

I want to link a Parseobject, let's call it movies to a facebook user. 我想链接一个Parseobject,我们称之为电影给facebook用户。 I'm trying to follow the tutorial about Relations : https://parse.com/docs/relations_guide#onetomany-pointers 我正在尝试关注有关关系的教程: https//parse.com/docs/relations_guide#onetomany-pointers

There is no sign of an example server side. 没有示例服务器端的迹象。 What i'm doing right now is : 我现在正在做的是:

ParseObject movie = new ParseObject("Movies");
movie.put("createdBy", ParseUser.getCurrentUser());

But in my table "Movies" in what type should i create my "createdBy" column ? 但在我的表格“电影”中我应该创建什么类型的“createdBy”列? Is it Pointer ? 它是指针吗? And if it is, toward what i should target it ? 如果是的话,我应该针对它?

I would suggest you to create a column 'createdBy' as a Relation. 我建议你创建一个列'createdBy'作为一个关系。 Once you have created this column in the data browser, you could use the following code(from the Parse docs): 在数据浏览器中创建此列后,您可以使用以下代码(来自Parse文档):

ParseObject movie = new ParseObject("Movies");
ParseRelation<ParseObject> relation = movie.getRelation("createdBy");
relation.add(ParseUser.getCurrentUser());
movie.saveInBackground();

This should create a Relation in the 'createdBy' column in the data browser. 这应该在数据浏览器的'createdBy'列中创建一个Relation。

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

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