how to get notification in flutter application, using database - database

I want to create a real time push notification whenever database(PHPMysql) table will update/change. I'm using PHP to send/get data from MYSQL database table. Is there any way to get notify the user when there is a change/update in database .
I want get real notification like flipkart, amezon and get notification on direct this device.
this app will open or close after updating database notification can get to this device.

Related

What is the most suitable way to save user's actions in react webpage (SPA)?

I'm building a SPA site in React (using redux).
To my site, any user can connect through Google or Facebook.
Each user who logs in to the site receives a personal user_id.
For each user, the system needs to keep a history of documents created by this same user (like the recent docs in Word).
I need to create functionality that whenever the user is logged in he will be able to see a history of the five documents he has created/updated.
In addition, the latest documents will load even after disconnecting and reconnecting to the system.
To load the history into the system I am thinking of using a dedicated index in ElasticSearch.
My question is which way would be suitable the most to use when the user is already logged in and creates several documents one after the other -
Should I need to save everything within the index in ES or is there a smart way to save and update the information locally without producing a lot of calls to DB?
I want that in the end there will be only 2 DB calls that are made in total - one call to load the information on login and one call to update the information when the user logs out. Any other create and update docs will save locally on the client side until leaving the site.

the best offline database for mobile

I made a complete app using firebase, expo and react native (with login screen and other features). But it didn't work as I expected because I need an app that the database works offline (I want the user to use the app offline, and then connect to the internet and "update" the data).
In other words, I'm looking for another way. I heard about Realm, but it doesn't work with Expo (from what I've researched). Can anyone guide me to some possibilities??
About the app I'm making: login>selection>release
*the user logs in (offline. The first time can be online, but when entering the app again, the login must be OFFLINE). The next screen is 'selection' (all screens show information of the logged in user), the user writes some information that is saved in a database. When completing the 'selection', the next screen is 'release', in which the user will add information in the same data table (db) before (from the 'selection' screen). The user will not have internet when entering the app (but he can access the internet later and update his data as soon as he connects).
Firebase work offline and import the data when it is online.
Now about the other db that works with expo, if you like working with SQL then there is something I built expo-sqlite-wrapper it is a good ORM and did not find any better.
There is also a JSON based database easy-db-react-native, the downside of this is that you can't have too much data saved.

How to architect a flutter app that submits lot of form data to backend API

I am currently building a Flutter App for both iOS and Android and the purpose of the app is to collect data from user via lots of forms and then submit it to a backend endpoint.
I need to consider number of things:
User completes half of the form(s) and wants to save locally but submit it later
User submits the form but gets network error so data should not be lost
user submits successfully. at this point data should be either deleted from local storage or be kept and later should get sync with backend db.
Technical points
I may need to use local db. What's the best approach for it?
Maintain global state until data is either stored or sent
I would like to reach out to stack overflow community where collegues may have run into similar situation and can give me some ideas/hints on how best I can architect the app. And What are the libraries / pub packages I can use.
I need to use Flutter only.
for storing the to be submitted data you might be looking for the shared preferences plugin. this lets you store data locally on the phone and lets you edit and delete this when the sync has been completed.

Map User Id with Connection Id

I am creating a chat application using Wpf. So far I have created all the basic interfaces and most of the methods required. I am maintaining a database and it also saves details of all the users along with an auto incremental user id.
I am trying to use SignalR to send messages between online users connected to a hub. At the same time, a copy of the message is saved in the database with a sending user id and receiving user id.
When a message is sent to a user via a hub, I specify the user id of the receiver of the message. But when sending it to the receiver from the hub, I don't know how to map the user id with the connection id of the receiver.
How can I accomplish this task?
Check out this link
Mapping ASP.NET SignalR Connections to Real Application Users
basically this is done by overriding OnConnected and OnDisconnected of Hub class

Persist client dependent data on Facebook db?

I'm totally new to fb coding. For a new project, I would like to create a fb app. The app is multi tenant, authorisation and authentication is carried out by fb. That's easy.
However, I would like to persistent data the user enters within fb. For example, there's a user dependent attribute 'mood'. The user may enter any string. Now my question: any possibility to persist such info on fb db?
There is no way for you to control the behavior or store the data persistently on FB. Instead you can get the attribute and persist in your sever
You can subscribe to real time data, when ever user modifies any data, you can receive notifications and you can pull the data.

Resources