Follow these steps to include the SDK into your mobile application project.
Open your Xcode project.
Go to File > Swift Packages > Add Package Dependency.
In the "Add Package Dependency" dialog box, paste the URL: https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution
Click "Next". Xcode will validate the package and its dependencies.
In the next dialog box, you'll be asked to specify the version or branch you want to use. You can choose main for the latest version or specify a specific version or branch.
After you've made your selection, click "Next".
You'll then be prompted to select the targets in your project that should include the package. Check the boxes for the targets you want to include.
Click "Finish" to add the package to your project.
Xcode will download and add the PassioNutritionAISDK to your project. You can now import and start using the PassioNutritionAISDK.
Download the "PassioNutritionAISDK.xcframework.zip" file from https://github.com/Passiolife/Passio-Nutrition-AI-iOS-SDK-Distribution/blob/main/PassioNutritionAISDK.xcframework.zip
Unzip it and drag and drop it into your project. Make sure to select "Copy items if needed".
In project "General" -> "Frameworks, Libraries and Embedded Content" Change to "Embed & Sign"
If opening from Xcode, right click and select 'open as source code'
To allow camera usage add:
The Passio Android SDK is shipped in the form of an .aar file.
In the build.gradle file add the PassioSDK dependency
Sync Project with Gradle Files and the PassioSDK interface should be available for usage.
Visit the releases page of the Android-Passio-SDK-Distribution GitHub repository. Download the passiolib-release.aar file from the latest release.
To include the .aar file into your project go to the module that will contain the food recognition feature. Place the .aar file in the libs folder of the module. If the libs folder is missing, create one. Reference the .aar file in the build.gradle file of the implementing module.
Sync Project with Gradle Files and be sure that you can reference the PassioSDK class within your code.
Passio Android SDK is powered by TensorFlow and FirebaseVision with the camera being managed by CameraX. Add the dependencies to these three projects by adding these lines to the module's build.gradle file.
In order for the SDK to work add the following lines to the android section of the module's build.gradle file.
Running Sync Project with Gradle Files will enable access to the SDK.
1. Create a Github Personal Access Token (classic) with read:packages
access selected.
2. Create an .npmrc
file in the root of your project with the following lines replacing GITHUB_ACCESS_TOKEN
with the token you've created.
3. Add the Passio SDK dependency to your package.json
and run npm install
or yarn
.
or
4. Ensure the native dependencies are linked to your app.
For iOS, run pod install.
If pod install is failed with error message Specs satisfying the ReactNativePassioSDK (from ../node_modules/@passiolife/nutritionai-react-native-sdk-v3) dependency were found, but they required a higher minimum deployment target.
, ensure Podfile is configured with minimum ios version '13.0'
For Android, add this implementation line to the dependencies section on app/build.gradle
file.
Also for Android, make sure the android project is configured with minSdkVersion 26 or above (check the project's build.gradle
file).
The Flutter SDK is available as a package on pub.dev
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
Add to top build.gradle file (Project: android)
The nutrition_ai build.gradle file dependency section should look like (Module: nutrition_ai)