User customisation
Mealz can provide a personalized experience for customers. To achieve this we propose two solutions:
- Preferences: Locally stored Actionable without customer consent by the retailer
- Profiling : Back hosted tastes Can be disabled by the customer
These two solutions are GDPR-compliant
Preferences
The preferences uses the native Android preference to make them persistent.
To enable this feature you need to provide a context and change the Mealz preference's configuration flag to true:
Example with Jetpack Compose :
import ai.mealz.core.Mealz
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Column {
// EnablePreference show preference button on Catalog
Catalog(this@MainActivity).apply { enablePreference(true) }.Content()
}
}
}
}
Profiling
Mealz offers to your customer a fully personalized experience based on their tastes. Our AI will learn from the customer's choices and suggest more and more specific recipes and product.
This feature can be disabled by the customer if they wish.
To do this, we expose this function:
// file MealzManager.kt
import ai.mealz.core.Mealz
class MealzManager(val appContext: Context) {
// allow profiling -> can we use your personal data to provide custom recipes?
Mealz.user.setProfilingAllowance(allowance: true)
}
Like recipe
You can disable the Like feature as well
// file MealzManager.kt
import ai.mealz.core.Mealz
class MealzManager(val appContext: Context) {
// allow users to heart recipes
Mealz.user.setEnableLike(isEnable: true)
}
The like feature will be set to TRUE by default
AuthLess
AuthLess mode allows Mealz to create an anonymous user and to find previous lists of non-connected users. Once the user connects to your app Mealz will merge anonymous user into the connected user.
You can enable AuthLess feature in mealz initialisation
import ai.mealz.core.Mealz
object MealzManager {
private var isInitialized = false
public fun initialize(applicationContext: Context) {
Mealz.Core {
sdkRequirement {
key = supplierKey
context = applicationContext
}
option { isAnonymousModeEnabled = true}
}
isInitialized = true
}
}
isAnonymousModeEnabled is defaulted to false
You can also provide Mealz a redirection function to your login page. We will use this function when connecting the user connection becomes mandatory, like adding the products to the basket. Even without supporting anonymous users, we can display Mealz Recipes on your apps, with CTAs requiring a user sign in.
import ai.mealz.core.Mealz
object MealzManager {
private var isInitialized = false
public fun initialize(applicationContext: Context) {
Mealz.user.setSignInRedirection = { /** your signin navigation method*/ }
Mealz.Core {
sdkRequirement {
key = supplierKey
context = applicationContext
}
option { isAnonymousModeEnabled = false}
}
isInitialized = true
}
}
if isAnonymousModeEnabled is set to true Mealz will never call your redirection function
Get Price Or Redirect
For Mealz to work properly, a store is mandatory. Without a store, we cannot generate a Recipe price, see the products, or purchase anything.
However, we provide a method that can fetch a price of a recipe, & if the store is not selected yet, redirect to the Store Selector. This is ideal when you have your own external Recipes that are not generated by Mealz (yet shared with us).
import ai.mealz.core.Mealz
Mealz.recipe.getPriceOrRedirect(recipeId = "14472", numberOfGuest = 4).await()