Get Started with the SDK¶
Sign up for a free account on Fritz in order to get started with machine learning in your apps.
Setup Your App with the CLI¶
The easiest way to register your existing app with Fritz is to use the CLI. Install the CLI and configure the app using your credentials.
>> pip install fritz >> fritz config update \ --api-key <YOUR API KEY> \ --project-id <YOUR PROJECT ID>
After the CLI is properly configured, go to your app directory and run app setup:
>> cd MyAwesomeApp/ >> fritz app setup
This will do 2 things:
- Register your iOS/Android application in Fritz.
- Add and configure the SDK in your app.
Open your app in XCode / Android Studios and run your app to finish setup.
Manually Setup the SDK¶
If you’d like to set up your app manually, you’ll have to register your app in Fritz and then follow the directions and add the code snippets to your app.
You’ll need the following before you can begin:
- Xcode 9.3 or later.
- Xcode project targeting iOS 10 or above. You will only be able to use features in iOS 11+, but you still can include Fritz in apps that target iOS 10+ and selectively enable for users on 11+.
- Swift projects must use Swift 4.1 or later.
- CocoaPods 1.4.0 or later.
- The bundle identifier of your app.
Installing the SDK
Add the Fritz SDK to your app using the following instructions. Before you add the SDK, you’ll need to create a project.
1. Add the SDK via CocoaPods
- Create a Podfile if you don’t have one:
$ pod init.
- Open your Podfile and add:
$ pod 'Fritz'.
- Save the file and run:
$ pod install.
This creates a .xcworkspace file for your app. Use this file for all future development on your application.
2. Make sure your app is registered with Fritz
After creating a project, you must register your app. If you have not done so, you can add an app from the Project Overview page.
3. Add Fritz-Info.plist to your app
Add the Fritz-Info.plist file to your app. Make sure to include it in all targets.
If you do not have the Fritz-Info.plist file, you can download it from the Project Settings page for your project. Click the plus button on the appropriate app and download.
4. Initialize in AppDelegate
1. Add the SDK
You can add the SDK using gradle.
2. Add Internet Permissions to Android Manifest
Edit your app’s AndroidManifest.xml to include INTERNET permissions. The model will always run offline and on-device. We require internet permissions to collect performance metrics on the models and improve them over time so that your app always runs smoothly.
3. Initialize the SDK onCreate
In your Application or MainActivity class, initialize SDK.
To find your API Key, go to the webapp “Your Project > Project Settings > Your App > Show API Key”