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.shared.notifications.toaster.listen(callBack: { event in
switch event as? ToasterNotification {
case ToasterNotification.RecipeAdded():
print("MealzNotification: Recipe Added")
case ToasterNotification.RecipeLiked():
print("MealzNotification: Recipe Liked")
default:
break
}
})
info
By default, notifications are disabled. You must provide content for the events you wish to enable for this to work.