Error with putting relation in parse object

Hi, I’m developing on android and trying to put a relation to a parse object. Like this :
message.put(“relation”, sender);
sender is a object retrived from Senders class and of course the “relation” column is connected to Senders class.
But I’m getting the following error :
Error : schema mismatch for Messages.relation; expected Relation but got Pointer
And also Messages is the class of message object.
Thanks in advance!

Hi. It should be:

ParseRelation<ParseObject> relation = message.getRelation("relation");
relation.add(sender);

You can find more details in this link: https://docs.parseplatform.org/android/guide/#relational-data

1 Like