I have developed an api for mobile app which uses Django rest framework as backend. Now I want to create notification to user. Whenever new lesson is added by admin, logged in user will have a notification.
Here is a lesson model
class Lesson(models.Model):
course = models.ForeignKey(Course, related_name='lcourse', on_delete=models.CASCADE,
null=True, blank=True)
name = models.CharField(max_length=200)
description = models.TextField(null=True, blank=True)
image = models.ImageField(upload_to='lesson/', null=True, blank=True)
def __str__(self):
return self.name
Try this:
Example:
You just need to use firebase. Get api key from their and your device_registration_id or device_token and your are all done.
For more you can follow the following link