Skip to main content
Version: 5.7

Notifications

Mealz provides a notification service to make your UI more interactive for customers. Currently we handle two events :

  • Recipe added to cart
  • Recipe liked

We have added notifications like Toaster, so you can add this to listen:

// show toast to users on certain events
Mealz.Notifications.toaster.listen { notification ->
when (notification) {
is ToasterNotification.RecipeAdded -> {
println("Mealz.Notifications.recipesCount recipe add")
}
is ToasterNotification.RecipeLiked -> {
println("Mealz.Notifications.recipesCount recipe like")
}
}
println("Mealz.Notifications.recipesCount $")
}
info

By default, notifications are disabled. You must provide content for the events you wish to enable for this to work.

Mealz provides a notification service to help you to know how many products are added to your store :


Mealz.notifications.basketSummary.listen { summary ->
println("number of product added to basket : ${summary.added}")
println("number of total product : ${summary.total}")
println("number of product mutualized in basket : ${summary.mutual}")
println("number of product out of stock : ${summary.outOfStock}")
}