In order to add on-device collections to your iOS app, it is necessary to:
- create an on-device collection in CraftAR;
- generate a collection bundle for your SDK version (On-device Image Recognition SDK or Augmented Reality SDK v4 +;
- download the bundle of that collection from CraftAR and add it to the app;
- you are ready to go and start using the on-device collection with the SDK
This tutorial covers the first step. For the second and third steps, please read the tutorial about how to Manage on-device collections for the iOS SDKs and Manage on-device collections for the Androis SDKs.
You can use on-device collections for two different purposes: On-device Image Recognition and on-device Augmented Reality. You can find more details for each case in our tutorials:
1. Create an On-Device Collection
The first step consists in creating a collection that can be used by the On-Device Image Recognition SDK or the Augmented Reality SDK v4 +. When creating a collection, select the On-Device Collection type in the create collection form.
2. Add items to this collection
The process of adding items is the same for all types of items. Take a look at the Tutorial about creating items in CraftAR for more details.
You can set URLs and custom data for each item. This information is added to the collection bundle that the SDK uses. At the time of recognition, it will be available locally offline in the On-device Image Recognition SDK.
For the Augmented Reality SDK v4 +, the collection bundles will only contain the AR items and all their contents will be embedded.
3. Create bundles
There is a specific section for On-Device Collections where you can manage the bundles. In this section, you can generate and download the bundles for the selected collection. Click on the menu bar shown on the screenshot below.
The steps to create a bundle are:
- Add an Application ID
- Generate Bundle for that Application ID
Add an Application ID
Each bundle is associated with an Application ID. You need to add your app id or use the default test App ID ( com.catchoom.test ). Note that you will need to purchase the On-Device Image Recognition SDK or the Augmented Reality SDK license if you want to add your own App ID’s. The on-device bundles get associated to your app through the AppID. For Android apps this is the package name; and for iOS, Bundle ID.
Add a new bundle
Press the button Add bundle to generate a new bundle for the selected collection. A dialog will prompt to ask which the SDK you want to generate the bundle for.
This process may take some time depending on the number of images in your collection and the system load. To check the status of the bundle you need to reload the page.
4. Download a bundle
When a bundle has status Ready (see screenshot below), it means the SDK can use it for recognition. You can decide between embedding the bundle into your app or download it at app initialization the first time the user opens the app. In the first case, your app will have a larger size but the initialization will be faster. The later case will keep your app size lower and the user will need some time to start scanning the very first time.
Use the Download button to download a zip file to embed into your app. (Make sure your browser keeps the file compressed when downloading.)