Django : notifications refresh automatically - django

I created a notification system adapted to my website and it's works. When a user is on home page, he can see his notifications.
But currently, for refresh his notifications the user have to reload the home page... (currently notifications visibles only on home page)
I want the notifications refresh automatically where there is a new notification, so without reload the page.
I want also user can be alerted by a new notification in all pages of my website (example : a div appears with notification
message).
How can I do this ?
Thank you !
PS : My Notification is very simple, so a Notification model with a Manager.

You can probably look at websockets. Check this out tornado
I dont know how you have setup your notification system, but making the use of websocket with combination of javascripting is way to go in my opinion.

Related

how to create realtime notification in django without using django channels

For every action such as-
log in
sign up
password reset
Notifications should be seen to the user with a notification bell icon (just like Facebook)
where real-time notifications are shown according to each action performed.
Also, an email should be sent to that user.
Note - (YOU CAN USE ANY DJANGO LIBRARY EXCEPT DJANGO CHANNELS)
this is the question that I want to solve. please help me.
You can use the Google Firebase Cloud Messaging service. There a lot of packages that work with this service. I recommend you to use fcm-django package for simplicity.

Is there anyway to initiate chat in dialogflow?

I am working in Dialogflow right now, is there any way to initiate chat using webhooks instead of using the common welcome massages given by dialogflow or some chat apps. Like I want to have my own initialize chats for many different situations. For example, today is my day to save money, then it will initiate a chat to make sure user get into save_money_daily intent. More details on the comment
There are few things that you wanted to do here that are not natural, I guess. Let me go on each:
How can I send an automatic chat for every possible case from the backend automatically?
Ans: You are building a google assistant on dialog flow, using as a chatbot, any chatbot can not send an automatic message(unless set by user), chatbots, and assistants are in the nature of the user interaction.
Let's any bot on Facebook, Skype, or any platform even the google assistant, they can't popup unwantedly with any information, it will be not user friendly.
There is a way to do, like if the user is interacting with your bot: You can ask like:
'Do you want me to remind you for saving money every day'
If user gives permission, save it in-app local cache and send app notification, via. Once the user get the app notification you can invoke the chat on the app notification click and open chat screen with your reply, but in the background when the user clicks on app notification you have to send a request to initiate chat.
And this solves your second problem as well.
Let me give you a high-level example:
Three Intent: With some user utterance
GetLatestMoive: ['get me the latest moives list']
GetLatestNews: ['Headline for today']
HealthCheck: ['I want health tips']
Create Notification and send it to the user via the app:
Based on the notification if the user clicks any of them, initiate your chat in-app with that utterance, it will automatically call the intent, and rest will follow based on your intent follow up a map and conversation design.
Hope this helps!

Is there any way to get public event informations from Facebook?

I know since Cambridge Analytica facebook API has suspended some endpoints. But I need facebook public events informations for a project. The informations I need are:
Event Name
Date and Time
Cover photo
Description
Event URL
Address
Event ID
Page ID
I'm doing a project for a client. It will request those data from server side and save it in database. Then it will show available events in a community website for specific locations. We don't need data about attendee list or their post on the wall. My client is willing to go through app review process. Question is does Facebook sdk provide those informations? Reading the documentation, my understanding is it only provide event informations that are attended by me or created in a page in which I'm an admin.
Is there any way to get these information? Let me be clear, I'm talking about public events. Not the one created by me or by my page.
Thank you in advance.
Just to be 100% sure, I just tried to access events of a Page I don´t own, with a live App that has Page Public Content Access approved, and did not get the events. (Tested with the /page-id/events endpoint.)
The docs tell you that accessing Page events is not possible in any case:
This is a restricted edge. You cannot request access at this time.
Source: https://developers.facebook.com/docs/graph-api/reference/page/events/

Notification Trigger event

I have a social marketing admin for my clients. I want to be able to update the admin when there is a new notification on their facebook fan page or a check in at their location.
Currently facebook sends me an email notification (for example when someone posts on the fan page wall). What I need is for a script to run that updates my admin whenever there is a unread notification.
What I don't want is to have to run a cron job every minute that grabs notifications. I have a lot of clients and a lot of fan pages. This would become very taxing.
Is there a way for facebook to push the notification to my script page instantly instead of querying every minute?
Real-time updates for pages do not cover feed content yet.
Currently facebook sends me an email notification (for example when someone posts on the fan page wall). What I need is for a script to run that updates my admin whenever there is a unread notification.
You could pipe incoming mail to a script, have it analyze the mail body (what page it was send for), and then trigger the notification …

Facebook like notification updates using django signal or notification

How can i use django-notifications or django-signals to make something like facebook updates notification that shows in the user profile if any other user likes or posts comments on user's blog or posts?
For the activity feed, we use https://github.com/justquick/django-activity-stream Documentation: http://justquick.github.com/django-activity-stream/
For the js widget and live notifications, we use https://github.com/subsume/django-subscription yourlabs example, it depends on redis but you can easily add a model backend if you really want to. Redis is a good choices it's half a megabyte of dependency. Documentation: http://django-social.rtfd.org
There is no application that does meta-notifications ("notification groupping") properly but a lot of research has been done. Basically you need another app, with a MetaNotification model, and something (management command, signal ...) that will visit notifications and create MetaNotification instances. Then you should display MetaNotification lists rather than Activity or notification list.
Finnaly, if you want configurable email notifications then you can use django-notifications: https://github.com/jtauber/django-notification or this app which looks nicer: http://www.tomaz.me/django-notifications/
I'm not aware of any app that does it all. It is going to be some work for you.
"It's a long way to the top if you wanna rock'n'roll" or as I like to say "patience and perseverance" :)
https://pypi.python.org/pypi/feedly allows you to build newsfeed and notification systems using Cassandra and/or Redis. Examples of what you can build are applications like the Facebook newsfeed, your Twitter stream or your Pinterest following page.