Last Updated on : 2024-07-01 08:14:16download
Travel products offer a range of advanced features to users. Most of these features are free for the first year and require renewal the following year to continue access to all features. Without renewal, end users can only access basic features. For a combo device, only Bluetooth is available, while for a cellular device, all features will be disabled.
You can use the following method to verify the logic for the value-added services.
Class (protocol) | Description |
---|---|
TSODValueAddedServicesService |
The value-added services. |
TSODValueAddedServicesModel |
The model for the value-added services. |
Check if the value-added service for an end user is valid. If the service has expired, disable the paid advanced value-added services and guide the end user to renewal.
API description
/// Get value-added services
/// - Parameters:
/// - devID: device ID
/// - success: success callback
/// - failure: failure callback
+ (void)fetchValueAddedServicesWithDevID:(NSString *)devID success:(void(^)(TSODValueAddedServicesModel *valueAddedServicesModel))success failure:(ThingFailureError)failure;
Example
[TSODValueAddedServicesService fetchValueAddedServicesWithDevID:self.device.deviceModel.devId success:^(TSODValueAddedServicesModel * _Nonnull valueaddedServicesModel) {
//...
} failure:^(NSError * _Nonnull error) {
//...
}];
Data model of TSODValueAddedServicesModel
Field | Type | Description |
---|---|---|
devId | NSString | The device ID. |
uuid | NSString | The UUID of the device. |
abilityMap | NSDictionary | The value-added service. |
Check if the renewal pop-up window appears. If it appears, this method will be invoked in the callback for closing the pop-up window to update hadPopup
in TSODValueAddedServicesModel
.
API description
/// Set value-added services VASAbilityModel - hadPopup
/// - Parameters:
/// - devID: device ID
/// - hadPopup: ture or false, only AbilityDataCloudStore can set this field.
/// - success: success callback
/// - failure: failure callback
+ (void)setValueAddedServicesPopWithDevID:(NSString *)devID hadPopup:(BOOL)hadPopup success:(ThingSuccessBOOL)success failure:(ThingFailureError)failure;
Example
[TSODValueAddedServicesService setValueAddedServicesPopWithDevID:self.deviceM.devId hadPopup:YES success:^(BOOL result) {
//...
} failure:^(NSError * _Nonnull error) {
//...
}];
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback