1
wei
2021-01-21 62d098cb78296feaa6f786a20748921338db838c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// TuyaSmartMessage.h
// TuyaSmartMessageKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <TuyaSmartUtil/TuyaSmartUtil.h>
#import "TuyaSmartMessageListModel.h"
#import "TuyaSmartMessageRequestModel.h"
 
NS_ASSUME_NONNULL_BEGIN
 
/// TuyaSmartMessage contains message center and push-related functions, and its messages are mainly divided into three major categories: alarms, families, and notifications, each of which is supported to be turned on or off respectively.
@interface TuyaSmartMessage : NSObject
 
/// Fetch message list.
/// @param listRequestModel Provide listRequestModel to fetch the TuyaSmartMessageListModel.
/// @param success Called when the task finishes successfully. A list of TuyaSmartMessageListModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)fetchMessageListWithListRequestModel:(TuyaSmartMessageListRequestModel *)listRequestModel
                                     success:(void (^)(NSArray<TuyaSmartMessageListModel *> *messageList))success
                                     failure:(TYFailureError)failure;
 
/// Fetch message detail list.
/// @param detailListRequestModel Provide a listRequestModel to fetch the TuyaSmartMessageListModel.
/// @param success Called when the task finishes successfully. A list of TuyaSmartMessageListModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)fetchMessageDetailListWithListRequestModel:(TuyaSmartMessageDetailListRequestModel *)detailListRequestModel
                                           success:(void (^)(NSArray<TuyaSmartMessageListModel *> *messageList))success
                                           failure:(TYFailureError)failure;
 
/// Get three types of messages if there are new ones.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)getLatestMessageWithSuccess:(TYSuccessDict)success failure:(TYFailureError)failure;
 
/// Set the message center list data to read.
/// @param readRequestModel List of read messages (support all read).
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)readMessageWithReadRequestModel:(TuyaSmartMessageListReadRequestModel *)readRequestModel success:(TYSuccessBOOL)success failure:(TYFailureError)failure;
 
 
/// Delete message center list data.
/// @param deleteRequestModel List of deleted messages (delete all is not supported).
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)deleteMessageWithDeleteRequestModel:(TuyaSmartMessageListDeleteRequestModel *)deleteRequestModel success:(TYSuccessBOOL)success failure:(TYFailureError)failure;
 
/// Canceling the ongoing operation.
- (void)cancelRequest;
 
@end
NS_ASSUME_NONNULL_END