This article applies to both the Image Recognition SDK and the Augmented Reality SDK.
Our mobile SDKs have an option to send Cloud Image Recognition queries to your back-end instead of sending them directly to CraftAR. This is useful for implementing some custom application logic 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: Used by the app to validate a collection token (SetCollection)
- Search URL: Used to send query images to perform a visual search
Here’s how to modify the URLs on iOS:
1
2
3
4
|
// 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:
1
2
3
4
|
// 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");
|