Our mobile SDKs have an option to send Cloud Image Recognition queries to your back-end instead of sending them to directly to CraftAR. This is useful for implementing some custom application logics on your server. Of course, you also need to forward them via API to the CraftAR service to close the loop. In this configuration, we call your back-end server a proxy server. Also, the option of sending the requests to your back-end is useful when you run CraftAR Enterprise in your own infrastructure.
In order to add your server as a proxy between your app and the CraftAR Service, you need to change the URLs used by the app to connect to CraftAR using the Image Recognition API. The urls of the API are the following:
- Connect URL (https://search.craftar.net/v2/timestamp): Used by the app to validate a collection token (SetCollection)
- Search URL (https://search.craftar.net/v2/search): Used to send query images to perform a visual search
Here's how to modify the URLs on iOS:
// Someplace before starting to use the CloudRecognition module // use your URLs here instead of the craftar.net ones [[CRSConnect sharedCRSConnect] setConnectURL: @"https://search.craftar.net/v2/timestamp"]; [[CRSConnect sharedCRSConnect] setSearchURL: @"https://search.craftar.net/v2/search"];
And here's how to modify the URLs on Android:
// Someplace before starting to use the CloudRecognition module // use your URLs here instead of the craftar.net ones CraftARCloudRecognition.Instance().setConnectURL("https://search.craftar.net/v2/timestamp"); CraftARCloudRecognition.Instance().setSearchURL("https://search.craftar.net/v2/search");