I have an android app which i connect to my server using REST API (django rest framework)
here is a scenario(and maybe my plan):
- data is sent back and forth as json
- I have a user model and a task model where users are owners of some task.
- Users typicaly sends a task to another user (with json similar to this: {"owner": "exampleuser", "from":"otheruser", "content":"example" ...} using POST method) -The tasks has a boolean field "completed" and is deleted once the task is completed (using PUT or PATCH method: completed = true,)
- once a new task gets created using POST method, the only way users can see any activities concerning their tasks is through an android activity that uses GET method to get a list of all the tasks owned by the user, by looking up all objects owned by the user
So my questions are:
- Instead of having the user to check the app everytime. How can I use GCM to push notify the user?
- How will it tell which user or device to send the push notification to?
- How does GCM knows when there has been a change to tasks or when a user POST a task?