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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top