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.
Analytics
To follow along to our analytics events, you can call:
// listen to analytics events
Mealz.notifications.analytics.listen {
println("Mealz.Notifications.analytics $it")
}