ios - How to mark conversation or message to be unread in a messaging app using ios7 and parse.com? -
I am creating a messaging app for iPhone using parses as my backend and I am sending messages to the inbox view How can I mark (no message view) because there are unread messages here? But I want the receiver to see it and not the sender ... Since push notifications are not always reliable, I should get a way to find out that the user has an unread message in some conversation threads.
Any input is highly appreciated.
Edit:
I have two classes, a conversation class that holds an array that keeps messages in the message class. This set up was thanked by the stock overflow member some time ago.
I have not tried to code any code here ... I do not even know how this will work ... I am trying to have new messages if I have So to flag the conversation, apply a method with my current setup, I thought about adding a column that indicates new messages inside this thread, and depending on it, I could possibly change the color of the cell in the inbox. I have this flag set, but then it will show for both the sender and the receiver ... I want this to show only for the receiver and since the receiver can be very much in this case, this is where I There is a problem ... It seems that there should be another class which monitors it unless nothing can be done with the current setup.
So does your current schema look like this?
Conversation: Class - Message: Array & lt; Message & gt; - Participants: Array & lt; _User & gt; Message: Class-body: String Regarding the countdown to the message count, you can do this with a counter like
< Code> Conversation: Class - Message: Array & lt; Message & gt; - Participants: Array & Lieutenant; Conversation Participant & gt; - MessageCount: Number Conversation Partners: Class - Reid Messacc: Number - User: Pointer & lt; _User & gt; Message: Class-body: string - redby: array and left; User & gt; The idea will be:
- Adding a message to the user conversation:
-
readBy messages - Increase
readMessageCount on the conversation - Add a participant
- to the conversation
- Message to
message - Read a message User (Receiver):
- Increase
readMessageCount - On the conversation partner, add
readBy to the array -
- Showing new message count on conversation:
- message count on conversation on conversation compare
- Showing a read / unread state per message
- Check that if
readBy is the pointer to the current user ( in it Most of these can be saved in the cloud code earlier or later Can save .
Comments
Post a Comment