Domanda

I am trying to create a part of my app which allows users to message one another. The messages will only be one-to-one PM. I'm using Parse as the backend. Any suggestions?

È stato utile?

Soluzione

You need to have an associative table ( create it from your Parse.com website account ) that should contains the pointer to the sender User, the pointer to the Receiver User and the message to send. So:

let's call the table class you need as "UsersChat"

objectId (string) default parse field

senderUser (Pointer:User) pointer to the user who send the message

receiverUser (Pointer:User) pointer to the user who will receive the message

message (string) concrete message to send

createdAt (Date) default parse field that contains the creation row, so the sent message date/time we can say

updatedAt (Date) default parse field

ACL (ACL) default parse field

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top