detectFoodFromImageURI
The image uri to detect food.
Import the PassioSDK
import {
PassioSDK,
type FoodCandidates,
} from '@passiolife/nutritionai-react-native-sdk-v3'
/**
* This method detect food from image uri.
* @param imageUri - The image uri to detect food.
* @returns A `Promise` resolving to a `FoodCandidates` object if the record exists in the database or `null` if not.
*/
detectFoodFromImageURI(imageUri: string): Promise<FoodCandidates | null>
Example
const [candidates, setCandidates] = useState<FoodCandidates | null>()
useEffect(() => {
PassioSDK.detectFoodFromImageURI(imageUri).then((foodCandidates) => {
setCandidates(foodCandidates)
})
}, [props.imageUri])
Last updated