Goal :- Detect database changes of firebase.
I am using firebase PHP CLIENT.
With using firebase php client i am able to
Connect to firebase node
Add / update and delete nodes.
List number of nodes.
Above functionality works perfectly.
But i want to achive functionlity of push notification when user goes offline in to the group as well as person to person chat.
Firebase database is real-time database so, how can i detect the changes of firebase database nodes so i can keep on watch on the message node changes and i should fire my push notification API from php.
The main functionality i want to achive is sending push notifications to group and person to person using firebase chat to mobile platform ( Ios and android ) .
Is there any alternatives avaialable for the same? OR any plugin which will does the same job?
Or in the another way is there any posibility to send push notifications using mobile end ( web independent ) ?
Any help would be appriciated.
Thanks in advance.
Related
I know how to create a simple notification in Flutter app , but I want to create a real time push notification whenever database(Mysql) 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 specific table.
Use Firebase Cloud Messaging https://firebase.google.com/docs/cloud-messaging
You can call the API via PHP. Here is the example Sending Firebase notification with PHP
I'm using firebase push notifications php api with android...
When I send a notification from firebase API, to android device, I also make a MySQL input, to register one copy of that, and work!
but...
What happen when the API sends too many push notifications?
There is no problem with my shared server?
I'm worried that my server will collapse for too many records for each push.
Right now It work like this...
Firebase API PHP send notification -> MySQL register that notification in one table -> Android Device recieve the notification.
but I don't think this is the right way...
so... the question is...
what is the proper way to save a firebase push notifications sent...?
I am wondering if it is possible to send push notifications to different Android applications. I can already send a push notification in same application but I want to send notification to different applications of mine. I have user application and driver application. I need to send push notification when user create order and driver get notification that "A new order is come" after driver accept. Acknowledgement notification get back to user.
I am using two different Google API for both Application, I think, its not good way...
Please give idea about this. ? thx
What you want is possible and not that strange at all, you have two applications registered for push in the developer console with two projects ids and want each of your Android application to be able to receive notifications from both ?
If thats what you want its possible you just need to register to both sender ids in the android applications check.
https://developer.android.com/google/gcm/adv.html#multi-senders
basically:
...
if (gcm == null) {
gcm = GoogleCloudMessaging.getInstance(context);
}
regid = gcm.register(SENDER_ID_ONE, SENDER_ID_TWO);
....
push notification with 2 different apps are possible,i make it one database for both apps for save token id, generate 2 push notification. its working fine
I am about to undertake the development of an app that requires sycning of data from the local device to an online DB...and back.
I am building something that will allow users to create events and invite users to those events. Users will also be able to chat and receive in app notifications. I would like to store the information in local storage that the user creates and push this information to an online DB when there is internet available. Then if there are any waiting events or notifications for that user, they can retrieve them when online also.
My concern is about the merging of data and the fact the local storage PK's will not be the same as the online PK's.
For example, user1 and user2 both just installed the app. They both create an event and invite each other to the event. Once they are both online their devices try to push the data to the online DB however there is a conflict with the PK used.
My question is: Can someone give me some guidance about how best to handle a situation like this? The app will be built using AS3 and Air and only for iOS and Android. There will be a MySQL remote DB with a PHP backend.
Any help is appreciated.
You could also send a time stamp of when it was sent to use with your PHP, where the request that got there last has an event sent back to notify the user (probably best with a push notification) that there has already been an event made.
Also not sure if you know already, but you can use NetConnection status to get a sense of when they connect to the internet.
localNc = new NetConnection();
localNc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
function netStatus(event:NetStatusEvent):void{
trace(event.info.code);
}
I have my Android client application that wait for a push message from the GCM Google server... on the server side, my web must store the registration ID of the device, in order to send the push notification to this specific device (calling the GCM Service with a specific PHP class).
The question is, how can I refresh the registration Id of the device every time It is registreted on the Google GCM servers? How can I associate to each users on the web app to a specific registration Id of the android app?
You can use PHpmyadmin tool to creat the data base and use the php script to open,store registration Id and close the db.