Value-Added Services v2.0

Last Updated on : 2024-11-18 05:59:46download

The Value-Added Services (VAS) UI BizBundle offers a range of IP camera (IPC) value-added services within the framework of IPC Value-Added Services v2.0. This BizBundle provides all the features needed by end users when purchasing and using value-added services, such as product display, placing orders, checking service details, and viewing order status.

By connecting to the IPC VAS BizBundle, you can easily integrate and use various value-added services, including IPC cloud storage, managed services, video inspection, 4G data plans, and AI event services.

To use Value-Added Services v2.0, you need to update the SDK and UI BizBundle to version 5.17.0 or later.

Preparation

Before integration, review the UI BizBundle setup and integration steps. For more information, see Integrate with Framework.

Component integration

Project configuration

Add the following dependencies to the build.gradle module:

dependencies {
    api enforcedPlatform("com.thingclips.smart:thingsmart-BizBundlesBom:${biz_bom_version}")
    api "com.thingclips.smart:thingsmart-bizbundle-camera"
    api "com.thingclips.smart:thingsmart-bizbundle-miniapp"
    api "com.thingclips.smart:thingsmart-bizbundle-homekit"
    api "com.thingclips.smart:thingsmart-bizbundle-ipckit"
    api "com.thingclips.smart:thingsmart-ipcsdk:${ipc_sdk_version}}"
     //... Other configuration
    api "com.thingclips.smart:thingsmart: ${sdk_version}}"
}
  • We recommend using the miniapp UI BizBundle for better performance and user experience.

  • Please switch to the miniapp UI BizBundle because the H5 VAS BizBundle is no longer updated.

Things to note

  • Make sure end users are logged in to your app before calling any interface.
  • Check whether your device supports the specific value-added service before using the service.
  • Navigate to the returned URL using UrlRouter.execute(urlBuilder).
  • Shared devices cannot purchase value-added services.

Value-added services homepage

API description

 void fetchValueAddedServiceUrl(CameraVASParams params, OperationCallBack callback);
Parameter Type Description
params CameraVASParams The request parameters.
callback OperationCallBack The callback.

CameraVASParams

Parameter Type Description
devId String The ID of the device.
spaceId String The space ID, passing homeId.
languageCode String The standard language code.
hybridType int The program type, ThingIPCConstant.
categoryCode String The VAS category code, ThingIPCConstant.
extInfo Object The extended information.

VAS category code constant

ThingIPCConstant constant Description
ThingIPCConstant.CATEGORY_CODE_SECURITY_CLOUD_SERVICE The cloud storage service.
ThingIPCConstant.CATEGORY_CODE_AI_SERVICE The AI event service.
ThingIPCConstant.CATEGORY_CODE_TRAFFIC_SERVICE The 4G traffic top-up service.
ThingIPCConstant.CATEGORY_CODE_AI_INSPECTION_SERVICE The inspection report service.

Program type constant

ThingIPCConstant constant Description
ThingIPCConstant.HYBRID_TYPE_H5 The H5 page.
ThingIPCConstant.HYBRID_TYPE_MINI_APP The miniapp.

Inspection report page

API description

   void fetchInspectionDetailUrl(CameraVASInspectionParams params, OperationCallBack callback);

Parameter Type Description
params CameraVASInspectionParams The request parameters.
callback OperationCallBack The callback.

CameraVASInspectionParams

Field Type Description
spaceId String The space ID, passing homeId.
devId String The ID of the device.
time long The time, retrieved from CameraMessageBean.
reportId String The report ID, which is inspectionReportId in getExtendParams of CameraMessageBean.
languageCode String The standard language code.
hybridType int The program type, ThingIPCConstant.
extInfo Object The extended information.

Sample code


CameraVASParams cameraVASParams = new CameraVASParams();
cameraVASParams.devId = mDevId;
cameraVASParams.spaceId = FamilyManagerUtils.getCurrentHomeId()+"";
cameraVASParams.languageCode = "zh";
cameraVASParams.categoryCode = ThingIPCConstant.CATEGORY_CODE_AI_INSPECTION_SERVICE;
cameraVASParams.hybridType = ThingIPCConstant.HYBRID_TYPE_MINI_APP;
ThingIPCSdk.getIPCVAS().fetchValueAddedServiceUrl(cameraVASParams, new OperationCallBack(){

            @Override
            public void onSuccess(int sessionId, int requestId, String data, Object camera) {
                Bundle bundle = new Bundle();
                bundle.putString("url", data);
                UrlBuilder builder = new UrlBuilder(mContext, "miniApp").putExtras(bundle);
                UrlRouter.execute(builder);
            }

            @Override
            public void onFailure(int sessionId, int requestId, int errCode, Object camera) {

            }
        });

// Inspection report
CameraMessageBean *messageBean;
CameraVASInspectionParams params = new CameraVASInspectionParams();
params.devId = mDevId;
params.spaceId = FamilyManagerUtils.getCurrentHomeId()+"";
params.languageCode = "zh";
params.time = messageBean.getTime();
params.reportId = messageBean.getExtendParams() == null ? "" : String.valueOf(messageBean.getExtendParams().get("inspectionReportId"));
params.hybridType = ThingIPCConstant.HYBRID_TYPE_MINI_APP;

ThingIPCSdk.getIPCVAS().fetchInspectionDetailUrl(params, new OperationCallBack(){

    @Override
    public void onSuccess(int sessionId, int requestId, String data, Object camera) {
        Bundle bundle = new Bundle();
        bundle.putString("url", data);
        UrlBuilder builder = new UrlBuilder(mContext, "miniApp").putExtras(bundle);
        UrlRouter.execute(builder);
    }

    @Override
    public void onFailure(int sessionId, int requestId, int errCode, Object camera) {

    }
});

Cloud storage

Check cloud storage support

Before proceeding to the cloud storage purchase page, verify whether your device supports the cloud storage service. For more information, see Support for cloud storage.

View and play cloud videos

After activating cloud storage, you can view and play videos stored in the cloud. For more information about APIs, see Cloud Storage.