Value-Added Services v1.0

Last Updated on : 2024-10-31 08:28:05download

Value-added services v1.0 use H5 pages, and UI BizBundle only provides cloud storage capabilities, with only a few categories. Value-Added Services v2.0 extends to multiple categories and adopts the miniapp architecture. 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.

Navigate to the subscription page

Step 1: Import the required header file

Objective-C

#import <ThingModuleServices/ThingCameraCloudServiceProtocol.h>

Swift

Add the following content to the bridging header file xxx_Bridging-Header.h:

#import <ThingModuleServices/ThingCameraCloudServiceProtocol.h>

Step 2: Navigate to the subscription page

API description

  • Before the API call, make sure that the user has logged in to the app.

  • Each subscription to the Cloud Storage for Videos service is mapped to a unique device. To get the cloud storage service page, ThingSmartDeviceModel of the device is required.

  • The Cloud Storage for Videos service page is returned as UIViewController. UINavigationController must be used to call the push or present method.

    • The Cloud Storage for Videos service is strongly correlated with user information.
    • The subscription page depends on the navigation controller, and navigation content settings are required. Therefore, the navigation controller must encapsulate the subscription page and navigation content.

Example

Objective-C

id<ThingCameraCloudServiceProtocol> impl = [[ThingSmartBizCore sharedInstance] serviceOfProtocol:@protocol(ThingCameraCloudServiceProtocol)];
[impl requestCloudServicePageWithDevice:self.deviceModel completionBlock:^(__kindof UIViewController *page, NSError *error) {
    if (page) {
        [self.navigationController pushViewController:page animated:YES];
    }
}];

Swift

let impl = ThingSmartBizCore.sharedInstance().service(of: ThingCameraCloudServiceProtocol.self)
(impl as? ThingCameraCloudServiceProtocol)?.requestCloudServicePage(deviceModel, completionBlock: { (page, error) in
        guard let cloudServiceVc = page {
            print("\(error!)")
        return
    }
    yourNaviController.pushViewController(cloudServiceVc, animated: true)
})