[Deprecated] Migrating from SDK 1.X to version 2.X
Introduction
This is a reference for upgrading from react-native-passio-sdk
v1.x.x
to v2.x.x
API Changes
Changed
configuration
ofFoodDetectionConfig
in PassioSDKRenamed
OCR
toPackagedFood
in PassioSDKPassioSDK.searchForFood
now returns apassioID and name
Removing
PassioSDK.getAttributesForName
Added
PassioSDK.getAttributesForPassioID
Refactor
PassioIconView
Nutrients in the
FoodItem
have been refactored fromNumber
toUnitMass
Changed configuration of FoodDetectionConfig in PassioSDK
In this version, we rename detectOCR with detectPackagedFood into Food Detection Configuration.
Renamed OCR
to PackageFood
OCR
to PackageFood
Renamed method of fetchAttributesForOCR
to fetchPassioIDAttributesForPackagedFood
PassioSDK.searchForFood
now returns a passioID and name
PassioSDK.searchForFood
now returns a passioID and nameThis method now returns passioID and name into the array of objects. Previously this method returned the name of the array only
Removing PassioSDK.getAttributesForName
PassioSDK.getAttributesForName
getAttributesForName(name: string): Promise<PassioIDAttributes | null>
The following API you have used to get attributes from passioID instead of name.
Added PassioSDK.getAttributesForPassioID
PassioSDK.getAttributesForPassioID
This method is to get the attributes using passioID.
Refactor PassioIconView
In V2, PassioIconView shows the food icon from the server, Previously this view displays food icon from the assets.
Nutrients in the FoodItem
have been refactored from Number
to UnitMass
FoodItem
have been refactored from Number
to UnitMass
In V2, change the nutrient data type number to UnitMass, UnitMass object which includes the unit and value.
The following list of nutrients has changed the number to UnitMass.
If at any point you need help from the Passio team, please reach out to us at support@passiolife.com
Last updated