LCStatus
Objective-C
@interface LCStatus : NSObject
Swift
class LCStatus : NSObject
发送和获取状态更新和消息
-
此状态的ID 具有唯一性
Declaration
Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *objectId;
Swift
var objectId: String? { get }
-
此状态在用户某个Type的收件箱中的ID
Warning
仅用于分片查询,不具有唯一性,同一条状态在不同的inbox里的messageId也是不同的Declaration
Objective-C
@property (nonatomic, readonly) NSUInteger messageId;
Swift
var messageId: UInt { get }
-
状态的创建时间
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) NSDate *createdAt;
Swift
var createdAt: Date? { get }
-
状态的内容
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSDictionary *data;
Swift
var data: [AnyHashable : Any]? { get set }
-
状态类型,默认是kLCStatusTypeTimeline, 可以是任意自定义字符串
Declaration
Objective-C
@property (nonatomic, copy) LCStatusType *_Nonnull type;
Swift
var type: String { get set }
-
获取某条状态
Declaration
Objective-C
+ (void)getStatusWithID:(nonnull NSString *)objectId andCallback:(nonnull LCStatusResultBlock)callback;
Swift
class func getWithID(_ objectId: String, andCallback callback: @escaping LCStatusResultBlock)
Parameters
objectId
状态的objectId
callback
回调结果
-
删除当前用户发布的某条状态
Declaration
Objective-C
+ (void)deleteStatusWithID:(nonnull NSString *)objectId andCallback:(nonnull LCBooleanResultBlock)callback;
Swift
class func delete(withID objectId: String, andCallback callback: @escaping LCBooleanResultBlock)
Parameters
objectId
状态的objectId
callback
回调结果
-
删除收件箱中的状态
Declaration
Objective-C
+ (BOOL)deleteInboxStatusForMessageId:(NSUInteger)messageId inboxType:(nonnull NSString *)inboxType receiver:(nonnull NSString *)receiver error:(NSError *_Nullable *_Nullable)error;
Swift
class func deleteInboxStatus(forMessageId messageId: UInt, inboxType: String, receiver: String) throws
Parameters
messageId
状态的 messageId
inboxType
收件箱类型
receiver
收件人的 objectId
-
删除收件箱中的状态,异步执行
Declaration
Objective-C
+ (void)deleteInboxStatusInBackgroundForMessageId:(NSUInteger)messageId inboxType:(nonnull NSString *)inboxType receiver:(nonnull NSString *)receiver block:(nonnull LCBooleanResultBlock) block;
Swift
class func deleteInboxStatusInBackground(forMessageId messageId: UInt, inboxType: String, receiver: String, block: @escaping LCBooleanResultBlock)
Parameters
messageId
状态的 messageId
inboxType
收件箱类型
receiver
收件人的 objectId
block
回调 block
-
获取当前用户收件箱里的状态
Declaration
Objective-C
+ (nonnull LCStatusQuery *)inboxQuery:(nonnull LCStatusType *)inboxType;
Swift
class func inboxQuery(_ inboxType: String) -> LCStatusQuery
Parameters
inboxType
收件箱类型
Return Value
用于查询的LCStatusQuery
-
获取当前用户发出的状态
Declaration
Objective-C
+ (nonnull LCStatusQuery *)statusQuery;
Swift
class func statusQuery() -> LCStatusQuery
Return Value
用于查询的LCStatusQuery
-
获取当前用户特定类型未读状态条数
Declaration
Objective-C
+ (void)getUnreadStatusesCountWithType:(nonnull LCStatusType *)type andCallback:(nonnull LCIntegerResultBlock)callback;
Swift
class func getUnreadStatusesCount(withType type: String, andCallback callback: @escaping LCIntegerResultBlock)
Parameters
type
收件箱类型
callback
回调结果
-
Reset unread count of specific status type (inbox).
Declaration
Objective-C
+ (void)resetUnreadStatusesCountWithType:(nonnull LCStatusType *)type andCallback:(nonnull LCBooleanResultBlock)callback;
Swift
class func resetUnreadStatusesCount(withType type: String, andCallback callback: @escaping LCBooleanResultBlock)
Parameters
type
Status type.
callback
Callback of reset request.
-
向用户的粉丝发送新状态
Declaration
Objective-C
+ (void)sendStatusToFollowers:(nonnull LCStatus *)status andCallback:(nonnull LCBooleanResultBlock)callback;
Swift
class func send(toFollowers status: LCStatus, andCallback callback: @escaping LCBooleanResultBlock)
Parameters
status
状态
callback
回调结果
-
向用户发私信
Declaration
Objective-C
+ (void)sendPrivateStatus:(nonnull LCStatus *)status toUserWithID:(nonnull NSString *)userId andCallback:(nonnull LCBooleanResultBlock)callback;
Swift
class func sendPrivateStatus(_ status: LCStatus, toUserWithID userId: String, andCallback callback: @escaping LCBooleanResultBlock)
Parameters
status
状态
userId
接受私信的用户objectId
callback
回调结果
-
发送
Declaration
Objective-C
- (void)sendInBackgroundWithBlock:(nonnull LCBooleanResultBlock)block;
Swift
func sendInBackground() async throws -> Bool
Parameters
block
回调结果