Last Updated on : 2024-03-04 07:34:02
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 ThingSuccessBOOL)success failure:(__nullable ThingFailureError)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
[[ThingSmartSDK 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 ThingSuccessHandler)success failure:(__nullable ThingFailureError)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;
[[ThingSmartSDK sharedInstance] setPushStatusWithStatus:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getDevicePushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[ThingSmartSDK sharedInstance] getDevicePushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Device alerts are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setDevicePushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)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;
[[ThingSmartSDK sharedInstance] setDevicePushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getFamilyPushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[ThingSmartSDK sharedInstance] getFamilyPushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Home messages are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setFamilyPushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)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;
[[ThingSmartSDK sharedInstance] setFamilyPushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getNoticePushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[ThingSmartSDK sharedInstance] getNoticePushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Notifications are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setNoticePushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)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;
[[ThingSmartSDK sharedInstance] setNoticePushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getMarketingPushStatusWithSuccess:(__nullable ThingSuccessBOOL)success failure:(__nullable ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
[[ThingSmartSDK sharedInstance] getMarketingPushStatusWithSuccess:^(BOOL result) {
// `result == YES`: Promotions are enabled.
} failure:^(NSError *error) {
}];
API description
- (void)setMarketingPushStatusWithStauts:(BOOL)enable success:(__nullable ThingSuccessHandler)success failure:(__nullable ThingFailureError)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;
[[ThingSmartSDK sharedInstance] setMarketingPushStatusWithStauts:enable success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)setDeviceDNDSettingStatus:(BOOL)flags success:(ThingSuccessHandler)success failure:(ThingFailureError)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
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
BOOL flags = YES;
[messageSetting setDeviceDNDSettingStatus:flags success:^{
// This feature is set.
} failure:^(NSError *error) {
}];
API description
- (void)getDeviceDNDSettingstatusSuccess:(ThingSuccessBOOL)success failure:(ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
success | The success callback. A Boolean value is returned. |
failure | The failure callback. An error message is returned. |
Example
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDeviceDNDSettingstatusSuccess:^(BOOL result){
// `result == YES`: DND is enabled for push notifications.
} failure:^(NSError *error) {
}];
API description
- (void)getDNDListSuccess:(ThingSuccessList)success failure:(ThingFailureError)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
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDNDListSuccess:^(NSArray *list){
// A list of DND periods is returned.
} failure:^(NSError *error) {
}];
API description
- (void)getDNDDeviceListSuccess:(ThingSuccessList)success failure:(ThingFailureError)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
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting alloc] init];
[messageSetting getDNDDeviceListSuccess:^(NSArray *list){
// A list of devices is returned.
} failure:^(NSError *error) {
}];
API description
- (void)addDNDWithDNDRequestModel:(ThingSmartMessageSettingDNDRequestModel *)requestModel success:(ThingSuccessHandler)success failure:(ThingFailureError)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
//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:^{
// The DND period is added.
} failure:^(NSError *error) {
}];
API description
- (void)modifyDNDWithTimerID:(long)timerID DNDRequestModel:(ThingSmartMessageSettingDNDRequestModel *)requestModel success:(ThingSuccessHandler)success failure:(ThingFailureError)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
//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:^{
// The DND period is modified.
} failure:^(NSError *error) {
}];
API description
- (void)removeDNDWithTimerID:(long)timerID success:(ThingSuccessHandler)success failure:(ThingFailureError)failure
Parameters
Parameter | Description |
---|---|
timerID | The timer ID. |
success | The success callback. |
failure | The failure callback. An error message is returned. |
Example
//ThingSmartMessageSetting *messageSetting = [[ThingSmartMessageSetting 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