更新时间:2024-03-04 07:34:01
消息推送开关为总开关,关闭状态下无法接收到设备告警、家庭消息、通知消息等任何消息。
接口说明
- (void)getPushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值,其中 false 表示无法接收到设备告警、家庭消息、通知消息等任何消息 |
failure | 失败回调,返回失败原因 |
示例代码
[[ThingSmartSDK sharedInstance] getPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示推送开关开启
} failure:^(NSError *error) {
}];
消息推送开关为总开关,关闭状态下无法接收到设备告警、家庭消息、通知消息等任何消息。
接口说明
- (void)setPushStatusWithStatus:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[ThingSmartSDK sharedInstance] setPushStatusWithStatus:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDevicePushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[ThingSmartSDK sharedInstance] getDevicePushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收设备告警消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setDevicePushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[ThingSmartSDK sharedInstance] setDevicePushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getFamilyPushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[ThingSmartSDK sharedInstance] getFamilyPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收家庭消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setFamilyPushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[ThingSmartSDK sharedInstance] setFamilyPushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getNoticePushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[ThingSmartSDK sharedInstance] getNoticePushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收通知消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setNoticePushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭,YES 表示开启 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[ThingSmartSDK sharedInstance] setNoticePushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getMarketingPushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
[[ThingSmartSDK sharedInstance] getMarketingPushStatusWithSuccess:^(BOOL result) {
// 当 result == YES 时,表示接收营销消息推送
} failure:^(NSError *error) {
}];
接口说明
- (void)setMarketingPushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
enable | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
BOOL enable = YES;
[[ThingSmartSDK sharedInstance] setMarketingPushStatusWithStauts:enable success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)setDeviceDNDSettingStatus:(BOOL)flags success:(ThingSuccessHandler)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
flags | 开启或关闭 |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
BOOL flags = YES;
[messageSetting setDeviceDNDSettingStatus:flags success:^{
// 设置成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDeviceDNDSettingstatusSuccess:(ThingSuccessBOOL)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回布尔值 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDeviceDNDSettingstatusSuccess:^(BOOL result){
// 当 result == YES 时,表示设备消息免打扰开关状态为开启
} failure:^(NSError *error) {
}];
接口说明
- (void)getDNDListSuccess:(ThingSuccessList)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回时间段数组 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDNDListSuccess:^(NSArray *list){
//获取消息免打扰时间段列表成功
} failure:^(NSError *error) {
}];
接口说明
- (void)getDNDDeviceListSuccess:(ThingSuccessList)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
success | 成功回调,返回所有家庭下所有设备列表数组 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDNDDeviceListSuccess:^(NSArray *list){
//获取设备列表成功
} failure:^(NSError *error) {
}];
接口说明
- (void)addDNDWithDNDRequestModel:(ThingSmartMessageSettingDNDRequestModel *)requestModel success:(ThingSuccessHandler)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
requestModel | 添加消息免打扰请求模型:
|
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSettingDNDRequestModel *requestModel = [[ThingSmartMessageSettingDNDRequestModel 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;
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting addDNDWithDNDRequestModel:requestModel success:^{
//添加成功
} failure:^(NSError *error) {
}];
接口说明
- (void)modifyDNDWithTimerID:(long)timerID DNDRequestModel:(ThingSmartMessageSettingDNDRequestModel *)requestModel success:(ThingSuccessHandler)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
timerID | time ID |
requestModel | 添加消息免打扰请求模型:
|
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSettingDNDRequestModel *requestModel = [[ThingSmartMessageSettingDNDRequestModel 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;
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
//long timerID = 1108056;
[messageSetting modifyDNDWithTimerID:timerID DNDRequestModel:requestModel success:^{
//修改成功
} failure:^(NSError *error) {
}];
接口说明
- (void)removeDNDWithTimerID:(long)timerID success:(ThingSuccessHandler)success failure:(ThingFailureError)failure
参数说明
参数 | 说明 |
---|---|
timerID | 定时器 ID |
success | 成功回调 |
failure | 失败回调,返回失败原因 |
示例代码
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
//long timerID = 1108056;
[messageSetting removeDNDWithTimerID:timerID success:^{
//移除成功
} failure:^(NSError *error) {
}];
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈