Migrating from SDK 2.X to version 3.X
Deprecated APIs
getAttributesForPassioID(passioID: PassioID): Promise<PassioIDAttributes | null>
fetchAttributesForBarcode(barcode: Barcode): Promise<PassioIDAttributes | null>
fetchPassioIDAttributesForPackagedFood(packagedFoodCode: PackagedFoodCode): Promise<PassioIDAttributes | null>
fetchSearchResult(result: FoodSearchResult): Promise<PassioIDAttributes | null>
onDowloadingPassioModelCallBacks: (downloadModelCallBack: DownloadModelCallBack) => Callback
Refactored APIs
getAttributesForPassioID
renamed tofetchFoodItemForPassioID
,Now use
fetchFoodItemForProductCode
instead offetchAttributesForBarcode and
fetchPassioIDAttributesForPackagedFood
and now returns a PassioFoodItem resultFixed typo mistake of
onDownloadingPassioModelCallBacks
fetchFoodItemForPassioID(passioID: PassioID): Promise<PassioFoodItem | null>
fetchFoodItemForProductCode(code: Barcode | PackagedFoodCode): Promise<PassioFoodItem | null>
onDownloadingPassioModelCallBacks: (downloadModelCallBack: DownloadModelCallBack) => Callback
searchForFood now returns PassioSearchResult and a list of search options. The PassioSearchResult represent a specific food item associated with the search term, while search options provide a list of possible suggested search terms connected to the input term.
searchForFood(searchQuery: string): Promise<PassioSearchResult | null>
fetchFoodItemForDataInfo(passioFoodDataInfo: PassioFoodDataInfo): Promise<PassioFoodItem | null>
We now provide detailed information on macro nutrients in our food search queries, including calorie
carbs
, protein
, and fat
, among other nutritional data.
Now
DetectedCandidate
havealternatives
andcroppedImage
Added a few more nutrients in
PassioNutrients
zinc,
selenium,
folicAcid,
vitaminKPhylloquinone,
vitaminKMenaquinone4,
vitaminKDihydrophylloquinone,
chromium
New APIs
fetchSearchResult returns a PassioFoodItem object for a given PassioSearchResult
searchForFood(searchQuery: string): Promise<PassioSearchResult | null>
fetchFoodItemForDataInfo(result: PassioFoodDataInfo): Promise<PassioFoodItem | null>
Added API to fetch suggestions for a certain meal time.
type MealTime = 'breakfast' | 'lunch' | 'dinner' | 'snack'
fetchSuggestions(mealTime: MealTime): Promise<FoodSearchResult[] | null>
fetchFoodItemForSuggestion(result: FoodSearchResult): Promise<PassioFoodItem | null>
To retrieve all macro and micronutrient values using
PassioSDK
by passing apassioFoodItem
you would typically follow these steps:
PassioSDK.fetchNutrientsSelectedSizeForPassioFoodItem(passioFoodItem)
PassioSDK.fetchNutrientsForPassioFoodItem(passioFoodItem,{
unit: calculatedWeightUnit,
value: calculatedWeight,
})
PassioSDK.fetchNutrientsReferenceForPassioFoodItem(passioFoodItem)
Last updated