Last Updated on : 2023-05-22 06:38:24
Returns the status of the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
- (void)getPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A value of false indicates that push notifications such as device alerts, home messages, and notifications cannot be received. |
failure | The failure callback. An error message is returned. |
Example
[[TuyaSmartSDK sharedInstance] getPushStatusWithSuccess:^(BOOL result) {
// `result == YES`: This feature is enabled.
} failure:^(NSError *error) {
}];
Returns the status of the push notifications feature. If this feature is disabled, device alerts, home messages, and notifications cannot be received.
API description
- (void)setPushStatusWithStatus:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
enable | Specifies whether to enable this feature. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setPushStatusWithStatus:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getDevicePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[TuyaSmartSDK sharedInstance] getDevicePushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Device alerts are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setDevicePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
enable | Specifies whether to enable this feature. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setDevicePushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getFamilyPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[TuyaSmartSDK sharedInstance] getFamilyPushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Home messages are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setFamilyPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
enable | Specifies whether to enable this feature. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setFamilyPushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getNoticePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[TuyaSmartSDK sharedInstance] getNoticePushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Notifications are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setNoticePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
enable | Specifies whether to enable or disable the notification feature. A value of YES represents that this feature is enabled. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setNoticePushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getMarketingPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[TuyaSmartSDK sharedInstance] getMarketingPushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Promotions are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setMarketingPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure
Parameters
Parameter | Description |
---|---|
enable | Specifies whether to enable this feature. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
BOOL enable = YES;
[[TuyaSmartSDK sharedInstance] setMarketingPushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)setDeviceDNDSettingStatus:(BOOL)flags success:(TYSuccessHandler)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
flags | Specifies whether to enable this feature. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
BOOL flags = YES;
[messageSetting setDeviceDNDSettingStatus:flags success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getDeviceDNDSettingstatusSuccess:(TYSuccessBOOL)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDeviceDNDSettingstatusSuccess:^(BOOL result){
// `result == YES`: DND is enabled for push notifications.
} failure:^(NSError *error) {
}];
API description
- (void)getDNDListSuccess:(TYSuccessList)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback with an array of DND periods returned. |
failure | The failure callback. An error message is returned. |
Example
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDNDListSuccess:^(NSArray *list){
// A list of DND periods is returned.
} failure:^(NSError *error) {
}];
API description
- (void)getDNDDeviceListSuccess:(TYSuccessList)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback with a list of devices for all homes returned. |
failure | The failure callback. An error message is returned. |
Example
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
[messageSetting getDNDDeviceListSuccess:^(NSArray *list){
// A list of devices is returned.
} failure:^(NSError *error) {
}];
API description
- (void)addDNDWithDNDRequestModel:(TuyaSmartMessageSettingDNDRequestModel *)requestModel success:(TYSuccessHandler)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
requestModel | The model to add a DND period. The following parameters are included:
|
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
//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:^{
// The DND period is added.
} failure:^(NSError *error) {
}];
API description
- (void)modifyDNDWithTimerID:(long)timerID DNDRequestModel:(TuyaSmartMessageSettingDNDRequestModel *)requestModel success:(TYSuccessHandler)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
timerID | The timer ID. |
requestModel | The model to add a DND period. The following parameters are included:
|
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
//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:^{
// The DND period is modified.
} failure:^(NSError *error) {
}];
API description
- (void)removeDNDWithTimerID:(long)timerID success:(TYSuccessHandler)success failure:(TYFailureError)failure
Parameters
Parameter | Description |
---|---|
timerID | The timer ID. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
//TuyaSmartMessageSetting *messageSetting = [[TuyaSmartMessageSetting alloc] init];
//long timerID = 1108056;
[messageSetting removeDNDWithTimerID:timerID success:^{
// The DND period is removed.
} failure:^(NSError *error) {
}];
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback