简体   繁体   English

是否可以将FCM通知发送给Firebase DB中输入的用户数据?

[英]Is there a way to send FCM notification to a user data input in Firebase DB?

I'm creating a project where when the user enters his trade reuirements to the application its data gets saved in Firebase database. 我正在创建一个项目,当用户向应用程序输入其贸易需求时,其数据将保存在Firebase数据库中。 is there a way to send push notification this user's device when he enters the data in firebasedatabase using firebase push notifications 当该用户的设备使用firebase推送通知在firebasedatabase中输入数据时,有没有办法发送推送通知

You can do by this way,When user enter the data into the firebasedatabase. 您可以通过这种方式进行操作,当用户将数据输入基于Firebase的数据库中时。
On Response Successfully,You can set the value against that currently user in firebasedatabase user node. 在“成功响应”上,您可以在firebasedatabase用户节点中为该当前用户设置值。 Then using addValueListener of firebase database to check that value which you set if exist then create a push notification like this 然后使用firebase数据库的addValueListener来检查您设置的值(如果存在),然后创建这样的推送通知

    NotificationManager notif=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
                Notification notify=new Notification.Builder(getApplicationContext())
.setContentTitle(tittle)
.setContentText(body)
                   .setContentTitle(subject)
.setSmallIcon(R.drawable.abc)
.build();

notify.flags |= Notification.FLAG_AUTO_CANCEL;
notif.notify(0, notify);

After this set value to null after push notification. 推送通知后,将此值设置为null之后。
I hope its helpful for you! 希望对您有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将推送通知FCM(Firebase云消息)发送给当前用户 - Send the push notification FCM (Firebase cloud messagging) to the current user 如何将Firebase(fcm)发送给多个用户以及每个用户不同的数据 - How to send firebase (fcm) to multiple users and different data per user 尝试从用户向用户 FCM 发送通知 - Trying to send notification from user to user FCM 使用 FCM 仪表板向特定用户发送通知 - Send notification to specific user using FCM Dashboard 使用带有数据的fcm和java向应用发送通知 - Send notification to apps using fcm and java with data 我想在管理员Feed数据Firebase时向用户发送通知 - I want to send notification to user whenever admin feed data firebase Firebase FCM 发送通知 OnMessageReceived PendingIntent 显示当前活动 - Firebase FCM send notification OnMessageReceived PendingIntent show current activity Android firebase向用户段发送通知以保存数据 - Android firebase send a notification to a user segment to save data 如何使用FCM向我数据库中的用户发送推送通知? 安卓 - How to send a push notification to a user that is in my database using FCM? android 使用cURL https://fcm.googleapis.com/fcm/send时,Firebase推送通知无法播放声音 - Firebase Push notification is not playing sound when using cURL https://fcm.googleapis.com/fcm/send
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM