website logo
⌘K
🚀Welcome to Eyrene!
🎉What's New
😎Tutorials
📱Mobile App
💻Web Portal
🔌API
Docs powered by archbee 

Android

To work with Eyrene Deeplink on Android:



1. Install and configure the SDK



To call the Eyrene app, create an Intent and call DeepLinkActivity with startActivityForResult.

Java
|
Intent launchIntent = new Intent();
launchIntent.setAction(DeepLinkConst.IC_CAMERA_LAUNCH_ACTION);



2. Sync Master Data

To work with the app offline, sync master data.

Note

We recommend syncing data once at the beginning of the day, with stable internet



Request parameters



DeepLinkConst.IC_CAMERA_LAUNCH_ACTION string

The intent of launch Eyrene on the device.



DeepLinkConst.Parameters.TOKEN string

Required. Calling application ID.



DeepLinkConst.Parameters.IC_COMMAND string

Control command.



DeepLinkConst.Parameters.LIST_CUSTOMER_ID string[]

An array of strings with CUSTOMER_ID store codes to sync data on these stores.



DeepLinkConst.Parameters.STRING_CUSTOMER_ID string

An alternative options list with CUSTOMER_ID store codes to sync data for these stores. In this format, a string with CUSTOMER_ID codes is passed, which is separated by a comma (",") without spaces.

If both methods are specified, then the values ​​from STRING_CUSTOMER_ID will be used.



Request example​

Java
|
Intent launchIntent = new Intent(DeepLinkConst.IC_CAMERA_LAUNCH_ACTION);

launchIntent.putExtra(DeepLinkConst.Parameters.TOKEN, getDemoToken());
launchIntent.putExtra(DeepLinkConst.Parameters.IC_COMMAND, DeepLinkConst.Commands.IC_SYNC);

String[] listCustomerId = {
   "id1",
   "id2",
   "id3",
   "id4",
   "id5"
}; // store list example
launchIntent.putExtra(DeepLinkConst.Parameters.LIST_CUSTOMER_ID, listCustomerId);

startActivityForResult(launchIntent, ICDeepLink.DEFAULT_REQUEST_CODE);


Response example​

Java
|
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (data == null) {
      return;
   }
   Log.d(TAG, "Result code: " + data.getIntExtra(DeepLinkConst.Parameters.RESULT_CODE, 0));
   Log.d(TAG, "Result info: " + data.getStringExtra(DeepLinkConst.Parameters.RESULT_INFO));
   Log.d(TAG, "list_customer_id: " + data.getStringExtra(DeepLinkConst.Parameters.LIST_CUSTOMER_ID));
}


Response parameters​



DeepLinkConst.Parameters.RESULT_CODE integer

Result code.

  • VISIT_VALID (int: 1) - successful visit (new or open). Completed with the button to close the visit.
  • VISIT_ERR (int: 2) - visit error. Detailed information in RESULT_INFO.
  • SYNC_OK (int: 3) - Synchronization completed successfully.
  • SYNC_ERR (int: 4) - Synchronization failed. Detailed information in RESULT_INFO.


DeepLinkConst.Parameters.RESULT_INFO string

Error description or additional information.



DeepLinkConst.Parameters.LIST_CUSTOMER_ID array

An array of strings with CUSTOMER_ID codes of stores for which sync is performed.



After the sync is completed, the control will automatically return to the calling app.





3. Start visit

You can start or open a visit for viewing without prior synchronization. In this case, you will need an Internet connection at the point of sale. Information about the store will be loaded at the beginning of the visit.

Request parameters​



DeepLinkConst.IC_CAMERA_LAUNCH_ACTION string

The intent of launch Eyrene on the device.



DeepLinkConst.Parameters.IC_COMMAND string

Control command.



DeepLinkConst.Parameters.DEBUG boolean

Enable debug mode. Displays a log with the output of the main errors and calling parameters. Optional.



DeepLinkConst.Parameters.TOKEN string

Required. Calling application ID.



DeepLinkConst.Parameters.VISIT_ID string

Required. Visit ID. If ID:

  • found — a visit will be opened;
  • not found — a new visit will be created;
  • empty or "0" - an error will be returned.


DeepLinkConst.Parameters.AGENT_ID string

Required. Agent ID in UUID format. If the agent ID is not found, a new agent will be created.



DeepLinkConst.Parameters.CUSTOMER_ID string

Required. Store ID. The store is searched for by CUSTOMER_ID (store -> customer_id). If the store:

  • not found - an error will be returned, the visit cannot be started;
  • found — all store tasks will be added to the visit.


DeepLinkConst.Parameters.TASK_FILTER string

Task filter. A regular expression (description) for filtering tasks by name. If specified, the visit will display tasks that match the specified filter. Optional.



Request example​

Java
|
Intent launchIntent = new Intent(DeepLinkConst.IC_CAMERA_LAUNCH_ACTION);

launchIntent.putExtra(DeepLinkConst.Parameters.DEBUG, true);
launchIntent.putExtra(DeepLinkConst.Parameters.TOKEN, getDemoToken());
launchIntent.putExtra(DeepLinkConst.Parameters.VISIT_ID, getDemoVisit());
launchIntent.putExtra(DeepLinkConst.Parameters.AGENT_ID, getDemoAgent());
launchIntent.putExtra(DeepLinkConst.Parameters.CUSTOMER_ID, getDemoCustomerID());
launchIntent.putExtra(DeepLinkConst.Parameters.TASK_FILTER, "regex");

startActivityForResult(launchIntent, ICDeepLink.DEFAULT_REQUEST_CODE);


Response example​

The results of the call are returned to the onActivityResult function.

Java
|
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (data == null) {
      return;
   }
   Log.d(TAG, "Result code: " + data.getIntExtra(DeepLinkConst.Parameters.RESULT_CODE, 0));
   Log.d(TAG, "Result info: " + data.getStringExtra(DeepLinkConst.Parameters.RESULT_INFO));
   Log.d(TAG, "Visit: " + data.getStringExtra(DeepLinkConst.Parameters.VISIT_ID));
   Log.d(TAG, "Agent: " + data.getStringExtra(DeepLinkConst.Parameters.AGENT_ID));
   Log.d(TAG, "Customer: " + data.getStringExtra(DeepLinkConst.Parameters.CUSTOMER_ID));
   Log.d(TAG, "Images: " + data.getIntExtra(DeepLinkConst.Parameters.TOTAL_IMAGES, 0));
}


Response parameters​



DeepLinkConst.Parameters.RESULT_CODE integer

Result code.

  • VISIT_VALID (int: 1) - successful visit (new or open). Completed with the button to close the visit.
  • VISIT_ERR (int: 2) - visit error. Detailed information in RESULT_INFO.
  • SYNC_OK (int: 3) - Synchronization completed successfully.
  • SYNC_ERR (int: 4) - Synchronization failed. Detailed information in RESULT_INFO.


DeepLinkConst.Parameters.RESULT_INFO string

Error description or additional information.



DeepLinkConst.Parameters.VISIT_ID string

Visit ID. Value as in input parameter.



DeepLinkConst.Parameters.AGENT_ID string

Agent ID. Value as in input parameter.



DeepLinkConst.Parameters.CUSTOMER_ID string

Store ID. Value as in input parameter.



DeepLinkConst.Parameters.TOTAL_IMAGES integer

The number of images in the visit.




Optional. Open the last visit

The OpenLastVisit command finds the ID of the last visit started in the store and opens it.

Request parameters​



DeepLinkConst.IC_CAMERA_LAUNCH_ACTION string

The intent of launch Eyrene on the device.



DeepLinkConst.Parameters.IC_COMMAND string

Control command.



DeepLinkConst.Parameters.DEBUG boolean

Enable debug mode. Displays a log with the output of the main errors and calling parameters. Optional.



DeepLinkConst.Parameters.TOKEN string

Required. Calling application ID.



DeepLinkConst.Parameters.AGENT_ID string

Required. Agent ID in UUID format. If the agent ID is not found, a new agent will be created.



DeepLinkConst.Parameters.CUSTOMER_ID string

Required. Store ID. The store is searched for by CUSTOMER_ID (store -> customer_id). If the store:

  • not found - an error will be returned, the visit cannot be started;
  • found — all store tasks will be added to the visit.


Request example​

Java
|
Intent launchIntent = new Intent(DeepLinkConst.IC_CAMERA_LAUNCH_ACTION);

launchIntent.putExtra(DeepLinkConst.Parameters.IC_COMMAND, DeepLinkConst.Commands.IC_OPEN_LAST_VISIT);
launchIntent.putExtra(DeepLinkConst.Parameters.DEBUG, true);
launchIntent.putExtra(DeepLinkConst.Parameters.TOKEN, getDemoToken());
launchIntent.putExtra(DeepLinkConst.Parameters.AGENT_ID, getDemoAgent());
launchIntent.putExtra(DeepLinkConst.Parameters.CUSTOMER_ID, getDemoStoreCustomerID());

startActivityForResult(launchIntent, ICDeepLink.DEFAULT_REQUEST_CODE);


Response example​

The results of the call are returned to the onActivityResult function.

Java
|
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (data == null) {
      return;
   }
   Log.d(TAG, "Result code: " + data.getIntExtra(DeepLinkConst.Parameters.RESULT_CODE, 0));
   Log.d(TAG, "Result info: " + data.getStringExtra(DeepLinkConst.Parameters.RESULT_INFO));
   Log.d(TAG, "Visit: " + data.getStringExtra(DeepLinkConst.Parameters.VISIT_ID));
   Log.d(TAG, "Agent: " + data.getStringExtra(DeepLinkConst.Parameters.AGENT_ID));
   Log.d(TAG, "Customer: " + data.getStringExtra(DeepLinkConst.Parameters.CUSTOMER_ID));
   Log.d(TAG, "Images: " + data.getIntExtra(DeepLinkConst.Parameters.TOTAL_IMAGES, 0));
}


Response parameters​



DeepLinkConst.Parameters.RESULT_CODE integer

Result code.

  • VISIT_VALID (int: 1) - successful visit (new or open). Completed with the button to close the visit.
  • VISIT_ERR (int: 2) - visit error. Detailed information in RESULT_INFO.
  • SYNC_OK (int: 3) - Synchronization completed successfully.
  • SYNC_ERR (int: 4) - Synchronization failed. Detailed information in RESULT_INFO.


DeepLinkConst.Parameters.RESULT_INFO string

Error description or additional information.



DeepLinkConst.Parameters.VISIT_ID string

Visit ID. Value as in input parameter.



DeepLinkConst.Parameters.AGENT_ID string

Agent ID. Value as in input parameter.



DeepLinkConst.Parameters.CUSTOMER_ID string

Store ID. Value as in input parameter.



DeepLinkConst.Parameters.TOTAL_IMAGES integer

The number of images in the visit.




Constants used in the Android Deeplink

The entire list of constants that are used in the Android Eyrene Deeplink API is described here.

Parameter List​

Java
|
public class DeepLinkConst {

   public static final String IC_CAMERA_LAUNCH_ACTION = "inspector.cloud.camera.DeepLinkActivity";
   public static final String IC_CAMERA_3_PACKAGE = "com.iccamera3.app";
   public static final String IC_CAMERA_3_ACTIVITY = "com.iccamera3.app.MainActivity";

   public static final class Parameters {
      public static final String TOKEN = "token";
      public static final String AGENT_ID = "agent_id";
      public static final String VISIT_ID = "visit_id";
      public static final String CUSTOMER_ID = "customer_id";
      public static final String LIST_CUSTOMER_ID = "list_customer_id";
      public static final String STRING_CUSTOMER_ID = "string_customer_id";
      public static final String TASK_FILTER = "task_filter";
      public static final String READONLY = "readonly";
      public static final String TOTAL_IMAGES = "total_images";
      public static final String DEBUG = "debug";
      public static final String VERSION_API = "version_api";
      public static final String VERSION_APP = "version_app";
      public static final String IS_NEW_VISIT = "is_new_visit";
      public static final String RESULT_CODE = "res_code";
      public static final String RESULT_INFO = "res_info";
      public static final String IC_COMMAND = "ic_command";

   }

   public static final class ResultCode {
      public static final int VISIT_VALID = 1;
      public static final int VISIT_ERR = 2;

      public static final int SYNC_OK = 3;
      public static final int SYNC_ERR = 4;
   }

   public static final class Commands {
      public static final String IC_SYNC = "sync";
      public static final String IC_OPEN_LAST_VISIT = "open_last_visit";
   }
}


Description​

DeepLinkConst​



DeepLinkConst.IC_CAMERA_LAUNCH_ACTION string

The intent for launching Eyrene on the device.



DeepLinkConst.IC_CAMERA_3_PACKAGE, DeepLinkConst.IC_CAMERA_3_ACTIVITY string

Components to run the Eyrene application.



Parameters​



DeepLinkConst.Parameters.TOKEN string

The token of the calling application.



 DeepLinkConst.Parameters.AGENT_ID string

Agent ID in UUID format.



DeepLinkConst.Parameters.VISIT_ID string

Visit ID



DeepLinkConst.Parameters.CUSTOMER_ID string

Store ID. The store is searched for by CUSTOMER_ID (store -> customer_id)



DeepLinkConst.Parameters.LIST_CUSTOMER_ID string[]

An array of strings with CUSTOMER_ID codes of stores for which sync is performed.



DeepLinkConst.Parameters.STRING_CUSTOMER_ID array

An alternative list option with CUSTOMER_ID store codes to synchronize data for these stores. In this format, a string with CUSTOMER_ID codes is passed, which is separated by a comma (",") without spaces. If both methods are specified in the command, then the values ​​from STRING_CUSTOMER_ID will be used.



DeepLinkConst.Parameters.TASK_FILTER string

Task filter. A regular expression (description) for filtering tasks by name. If specified, the visit will display tasks that match the specified filter.



DeepLinkConst.Parameters.READONLY boolean

Задает режим открытия визита только для чтения. В этом режиме задачи доступны только для просмотра.



DeepLinkConst.Parameters.TOTAL_IMAGES integer

The number of images in the visit.



DeepLinkConst.Parameters.DEBUG boolean

Enable debug mode. Displays a log with the output of the main errors and calling parameters.



DeepLinkConst.Parameters.VERSION_API integer

The version of the built-in API in the app.



DeepLinkConst.Parameters.VERSION_APP integer

Application version code.



DeepLinkConst.Parameters.IS_NEW_VISIT boolean

A flag indicating a newly created visit.



ResultCode​



DeepLinkConst.Parameters.RESULT_CODE integer

Result code.

  • VISIT_VALID (int: 1) - successful visit (new or open). Completed with the button to close the visit.
  • VISIT_ERR (int: 2) - visit error. Detailed information in RESULT_INFO.
  • SYNC_OK (int: 3) - Synchronization completed successfully.
  • SYNC_ERR (int: 4) - Synchronization failed. Detailed information in RESULT_INFO.


DeepLinkConst.Parameters.RESULT_INFO string

Error description or additional information.



Commands​



DeepLinkConst.Parameters.IC_COMMAND string

Control command. Supported commands:

  • IC_SYNC - perform sync;
  • IC_OPEN_LAST_VISIT - open the last visit to the specified store.

Possible errors

If while Eyrene is running:

  • if theapplication was closed by the system or by the user using the "Running Tasks / Delete Eyrene" button, VISIT_ERR will be returned as a result.
  • a failure occurred - depending on the type of failure, either VISIT_ERR or Intent data returns null.



Updated 14 Apr 2022
Did this page help you?
Yes
No
PREVIOUS
Authorization
NEXT
iOS
Docs powered by archbee 
TABLE OF CONTENTS
1. Install and configure the SDK
2. Sync Master Data
Request parameters
Request example​
Response example​
Response parameters​
3. Start visit
Request parameters​
Request example​
Response example​
Response parameters​
Optional. Open the last visit
Request parameters​
Request example​
Response example​
Response parameters​
Constants used in the Android Deeplink
Parameter List​
Description​
DeepLinkConst​
Parameters​
ResultCode​
Commands​
Possible errors