import {
PassioSDK,
type PersonalizedAlternative,
} from '@passiolife/nutritionai-react-native-sdk-v3'
/**
* This method adds personalized alternative to local database.
* Status: This method is experimental and only available in the iOS SDK.
* @param personalizedAlternative - The personalized alternative to add.
* @returns A `boolean` value indicating if the personalized alternative was added successfully.
*/
addToPersonalization(
personalizedAlternative: PersonalizedAlternative
): boolean
const personalizedAlternative = {
visualPassioID: "PassioID"
nutritionalPassioID: "PassioID"
servingUnit: "g"
servingSize: 10
}
const addToPersonalization = async (personalizedAlternative: PersonalizedAlternative) => {
try {
const isPersonalization = await PassioSDK.addToPersonalization(personalizedAlternative)
} catch (error) {
console.log('error', error)
}
}