回答

0

您可以通過這樣做,當用戶輸入數據到firebasedatabase進入中firebasedatabase數據發送推送通知該用戶的設備。
成功響應,您可以在firebasedatabase用戶節點中針對當前用戶設置值。然後使用火力數據庫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); 

推送通知推送通知後,空該設定值後,設定值。
我希望它對你有幫助!

相關問題