private fun addToFavs() {
val myFirebaseRef = FirebaseDatabase.getInstance().reference
val newData=myFirebaseRef!!.child(AppConstants.FirebaseNodes.userNode).child(auth.currentUser!!.uid).child("fav").child(
business.id).child("id").push()
newData.setValue(business.id)
.addOnCompleteListener { task: Task<Void?> ->
if (task.isSuccessful) {
Log.d(TAG, "added to fav")
} else {
Log.e(TAG, "Error getting data", task.exception)
Toast.makeText(activity, "Error " + task.exception, Toast.LENGTH_SHORT).show()
}
}
}
{
"TTmr8YNOaIQ6ZlJlHw2sONOLCz72": {
"email": "arfaatqureshi232@hotmail.com",
"fcmToken": "fv-otj0pR6OnSUNY2buZtb:APA91bGEBV80jo-SnJBHfJ6MxSXj0gLfvV9BKxX2SOmHstvLbUpRB0oxmSWRsfRsCJEnJ-D77UTbhRIFv8cUQEozA68_wOeYm5es7klErvfi96Huez7KWsK5FrBfAmf2J-9ZqNhGvV5a",
"followingStores": {
"oGURUwXDgmgiXggcrnRAcNj0AMs1": {
"id": "oGURUwXDgmgiXggcrnRAcNj0AMs1"
}
},
"id": "TTmr8YNOaIQ6ZlJlHw2sONOLCz72",
"isOnline": true,
"lat": 0,
"lng": 5,
"mobileNo": "034396524876",
"name": "a.qureshi",
"online": true
}
}