Skip to main content

Open 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

Intent launch IC Camera on the device. If both applications are installed, a dialog box will appear asking you to select the version of IC Camera.


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.

By CUSTOMER_ID a store is searched (store -> customer_id). If the store:

  • not found — an error will be returned, visit not found;
  • found — information about the last visit to the store will be returned.

Request example


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.

@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 definitions


DeepLinkConst.Parameters.RESULT_CODE integer

Result code.

  • VISIT_VALID (int: 1) - successful visit (new or opened). Completed with the button to close the visit.
  • VISIT_ERR (int: 2) - visit error. See RESULT_INFO for details.
  • SYNC_OK (int: 3) - synchronization was successful.
  • SYNC_ERR (int: 4) - synchronization failed. See RESULT_INFO for details.

DeepLinkConst.Parameters.RESULT_INFO string

Description of the error or additional information.


DeepLinkConst.Parameters.VISIT_ID string

Visit ID.


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.


If you have any questions or problems, contact support.