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 }
  • 状态的发出"人",可以是LCUser 也可以是任意的LCObject,也可能是nil

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) LCObject *source;

    Swift

    var source: LCObject? { 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

    - (void)setQuery:(nonnull LCQuery *)query;

    Swift

    func setQuery(_ query: LCQuery)

    Parameters

    query

    限定条件

获取状态 */

发送状态 */