android - Firebase Save Notification to DB not working when app is not running -
i handling fcm notifications in app. in public void onmessagereceived(remotemessage remotemessage) { notification notification = new notification(); notification.settitle(remotemessage.getnotification().gettitle()); notification.setdescription(remotemessage.getnotification().getbody()); dateformat simpledateformat = new simpledateformat("dd/mm/yyyy"); dateformat simpletimeformat = new simpledateformat("hh:mm"); date date = new date(remotemessage.getsenttime()); notification.settime(simpletimeformat.format(date)); date date2 = new date(); notification.setdate(simpledateformat.format(date2)); databasehelper databasehelper = new databasehelper(getapplicationcontext()); databasehelper.savenotification(notification); //calling method generate notification sendnotification(remotemessage.getnotification().getbody()); } but when app not running or in b...