Last Updated on : 2024-10-31 08:27:41download
Value-added services v1.0 use H5 pages. It is strongly recommended that you upgrade to v2.0 and choose the miniapp page. H5 pages will no longer be iterated in the future.
Please upgrade to the latest value-added service plan.
build.gradle
of module
.
dependencies {
api enforcedPlatform("com.thingclips.smart:thingsmart-BizBundlesBom:${biz_bom_version}")
api "com.thingclips.smart:thingsmart-bizbundle-cloud_storage"
api "com.thingclips.smart:thingsmart:${sdk_version}}"
}
API description
The Cloud Storage for Videos service is strongly correlated with user information. Therefore, the navigation can be enabled as expected only when the user has logged in to the app.
public void buyCloudStorage(Context mContext, DeviceBean deviceBean, String homeId, AbsCloudCallback callback);
Parameters
Parameter | Description |
---|---|
context | The context. |
deviceBean | The information about the device. |
homeId | The home ID. |
callback | The failure callback. |
Example
findViewById(R.id.buy_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Returns service data.
AbsCameraCloudPurchaseService cameraCloudService = MicroServiceManager.getInstance().findServiceByInterface(AbsCameraCloudPurchaseService.class.getName());
if (cameraCloudService != null) {
cameraCloudService.buyCloudStorage(CameraCloudStorageActivity.this,
ThingHomeSdk.getDataInstance().getDeviceBean(devId),
String.valueOf(FamilyManager.getInstance().getCurrentHomeId()), new AbsCloudCallback() {
@Override
public void onError(String errorCode, String errorMessage) {
super.onError(errorCode, errorMessage);
}
});
}
}
});
Releases resources consumed for navigation to the service purchase page during the call of destroying the page. API requests and other time-consuming operations are processed in the navigation.
API description
public void destroy();
Example
@Override
protected void onDestroy() {
super.onDestroy();
AbsCameraCloudPurchaseService cameraCloudService = MicroServiceManager.getInstance().findServiceByInterface(AbsCameraCloudPurchaseService.class.getName());
if (cameraCloudService != null) {
cameraCloudService.destroy();
}
}
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback