更新时间:2023-03-09 08:04:34
消息推送开关为总开关,关闭状态下无法接收到设备告警、家庭消息、通知消息等任何消息。
接口说明
- (void)getPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值,其中 false 表示无法接收到设备告警、家庭消息、通知消息等任何消息 |
failure | 失败回调,返回失败原因 |
示例代码
[[TuyaSmartSDK sharedInstance] getPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示推送开关开启
} failure:^(NSError *error) {
}];
消息推送开关为总开关,关闭状态下无法接收到设备告警、家庭消息、通知消息等任何消息。
接口说明
- (void)setPushStatusWithStatus:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setPushStatusWithStatus:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDevicePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[TuyaSmartSDK sharedInstance] getDevicePushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收设备告警消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setDevicePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setDevicePushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getFamilyPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[TuyaSmartSDK sharedInstance] getFamilyPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收家庭消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setFamilyPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setFamilyPushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getNoticePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[TuyaSmartSDK sharedInstance] getNoticePushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收通知消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setNoticePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭,YES 表示开启 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setNoticePushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getMarketingPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[TuyaSmartSDK sharedInstance] getMarketingPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收营销消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setMarketingPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setMarketingPushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)setDeviceDNDSettingStatus:(BOOL)flags success:(TYSuccessHandler)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
flags | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
BOOL flags = YES;
[messageSetting setDeviceDNDSettingStatus:flags success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDeviceDNDSettingstatusSuccess:(TYSuccessBOOL)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDeviceDNDSettingstatusSuccess:^(BOOL result){
// 当 result == YES 时,表示设备消息免打扰开关状态为开启
} failure:^(NSError *error) {
}];
接口说明
- (void)getDNDListSuccess:(TYSuccessList)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回时间段数组 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDNDListSuccess:^(NSArray *list){
//获取消息免打扰时间段列表成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDNDDeviceListSuccess:(TYSuccessList)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回所有家庭下所有设备列表数组 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDNDDeviceListSuccess:^(NSArray *list){
//获取设备列表成功
} failure:^(NSError *error) {
}];
接口说明
- (void)addDNDWithDNDRequestModel:(TuyaSmartMessageSettingDNDRequestModel *)requestModel success:(TYSuccessHandler)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
requestModel | 添加消息免打扰请求模型:
|
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSettingDNDRequestModel *requestModel = [[TuyaSmartMessageSettingDNDRequestModel alloc] init];
//requestModel.startTime = @"07:10";
//requestModel.endTime = @"23:00";
//requestModel.devIDs = @[@"***",@"***"];
//0 means close that day, 1 means open on the day. @"0000111" means Friday to Sunday open. That's the same thing as index =0 starting on Monday
//requestModel.loops = @"0000111";
//requestModel.isAllDevIDs = YES;
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting addDNDWithDNDRequestModel:requestModel success:^{
//添加成功
} failure:^(NSError *error) {
}];
接口说明
- (void)modifyDNDWithTimerID:(long)timerID DNDRequestModel:(TuyaSmartMessageSettingDNDRequestModel *)requestModel success:(TYSuccessHandler)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
timerID | time ID |
requestModel | 添加消息免打扰请求模型:
|
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSettingDNDRequestModel *requestModel = [[TuyaSmartMessageSettingDNDRequestModel alloc] init];
//requestModel.startTime = @"07:10";
//requestModel.endTime = @"23:00";
//requestModel.devIDs = @[@"***",@"***"];
//0 means close that day, 1 means open on the day. @"0000111" means Friday to Sunday open. That's the same thing as index =0 starting on Monday
//requestModel.loops = @"0000111";
//requestModel.isAllDevIDs = YES;
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
//long timerID = 1108056;
[messageSetting modifyDNDWithTimerID:timerID DNDRequestModel:requestModel success:^{
//修改成功
} failure:^(NSError *error) {
}];
接口说明
- (void)removeDNDWithTimerID:(long)timerID success:(TYSuccessHandler)success failure:(TYFailureError)failure
参数说明
参数 | 说明 |
---|---|
timerID | 定时器 ID |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
//long timerID = 1108056;
[messageSetting removeDNDWithTimerID:timerID success:^{
//移除成功
} failure:^(NSError *error) {
}];
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈