Skip to main content
Version: 5.6

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.

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

Mealz.shared.notifications.basketSummary.listen(callBack: { summary in
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}")
}