Using FCM with django and flutter - django

I have a django backend server and I want to send notification to my flutter app. I want to use Firebase Cloud Messaging for this.
My question is, do I need to store something in my database to send notification to the app? I was planning to use django_push_notification on the backend side.

You need to store the device id on the server to be able to send push notifications to your app. You can use this django app to expose rest endpoints the id registration and sending notifications: https://github.com/xtrinch/fcm-django

Related

How to use FCM pkg on Django?

I'm using the fcm_django package to send notifications API to Firebase but I have some confusion about those two concepts on Firebase like so: (registeration_id and device_id)
https://fcm-django.readthedocs.io/en/latest/#setup
I placed the "server_key" of Firebase to registration_id but don't understand what does device_id means and what is the value I should put on it?
after answering the above questions I tried to send notification from Django by the admin page on Django by creating registration_id which is "server_key" and defining the type which is a "web", but when I created this object I didn't see any message has been sent to Firebase cloud.
Note:-
I want to send notifications to only one device not many users.
so, can anyone help me to achieve this mission succeeded?
Thanks in advance
The device_id is a token that is generated by the Firebase SDK on each device/app combination that wants to receive messages from FCM.
To learn how to access this token, have a look at the documentation for Android, Web and iOS.
Once you have the token on the specific client, you will need to send it to a place where the fcm-django package can then also access it; typically a cloud hosted database, such as the Realtime Database or Firestore that are also part of Firebase.
From there your Django can then get the token, and pass it to the fcm-django API.

Listen to events from conversation apps like Slack and update Django database

I want to build a Django app which listens to events from messaging apps and writes them in a database.
For eg, in Slack, on channel creation, I want to create a new entity in database and when a message is posted in that channel, I want to update that entity with the message.
I want the app to work similarly for other apps like Telegram, Discord etc.
How can I implement this using a common backend API for all the apps, i.e. a common API which listens to the events and updates the db ?
Or is there some third-party API available (for eg. Twilio maybe) which can fulfil my purpose ?

Where should I make a python-twitter API call in my Django/React webapp

I'm creating a full stack web app using react, react-redux, and Django-rest, and I need to make an API call using the python-twitter api, then display the data from this request in my react frontend. The flow of control will be a user enters their twitter username in the frontend, which needs to trigger an API call using this username in the Django backend. Then the data from this call needs to be fed back into the React frontend using redux. Where should I be making this API call in the Django backend?
You can make authentication and configuration of the python-twitter in Django Backend. Then you can simply call the API's from the react web application. I have made for it. Here you go: python-twitter boiler-plate. Hope this helps :)

how do I make django and tornado communicate with each other

I have a social networking kinda an app in Django and I wanna integrate real-time notifications and messaging functionality in my app.
my friends could build a tornado app but I wanna basically connect them together (my guess are I have to make a REST API correct me if I'm wrong)
how can I do these kinda tasks from Django
Authenticate automatically to a WebSocket(tornado) as I logged in my
django app
import all of my friends
send tornado signal to send notifications if the user didn't receive a message
things like that
how do I do stuff like that.
(BTW I don't wanna use django channels as it's fairly new)
You can use a message broker library like ZeroMQ or RabbitMQ to help them communicate with each other (The Django instance and the Tornado websockets component).
They provide several message architectures like server-client or publisher-subscriber.

Firebase for Push Notifications only

I want to develop a web application with a database using Django/Grails/Express
I want to use Firebase just for sending Push Notifications to an Iphone. Do i need develop the webapplication (including the database) in firebase or can i develop the web application using Django/Grails/Express and use Firebase just for sending Push Notifications?
Do all web frameworks (Django/Grails/Express) support Firebase? Will Firebase be free to use in my case?
EDIT: How to i use Firebase with Django/Grails/Express? Is there an API or library i need to download?
Thank you in advance!
You can pick and choose which Firebase products you wish to use in your app. You may use as many or as few as you want. There is no obligation to use anything that you don't want to use. There is no charge for using Firebase Cloud Messaging in your app.
In this url https://cloud.google.com/community/tutorials/grails3-send-push-notification-using-firebase-cloud-messaging you can read about the process for sending push notifications using grails as backend