LCFriendship

Objective-C

@interface LCFriendship : NSObject

Swift

class LCFriendship : NSObject

Friendship.

  • The request for becoming friends.

    Declaration

    Objective-C

    + (void)requestWithUserId:(nonnull NSString *)userId
                     callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func request(withUserId userId: String, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    userId

    The ID of the target user.

    callback

    Result callback.

  • The request for becoming friends.

    Declaration

    Objective-C

    + (void)requestWithUserId:(nonnull NSString *)userId
                   attributes:(NSDictionary *_Nullable)attributes
                     callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func request(withUserId userId: String, attributes: [AnyHashable : Any]? = nil, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    userId

    The ID of the target user.

    attributes

    Custom key-value attributes.

    callback

    Result callback.

  • Accept a friendship request.

    Declaration

    Objective-C

    + (void)acceptRequest:(nonnull LCFriendshipRequest *)request
                 callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func accept(_ request: LCFriendshipRequest, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    request
    callback

    Result callback.

  • Accept a friendship request.

    Declaration

    Objective-C

    + (void)acceptRequest:(nonnull LCFriendshipRequest *)request
               attributes:(NSDictionary *_Nullable)attributes
                 callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func accept(_ request: LCFriendshipRequest, attributes: [AnyHashable : Any]? = nil, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    request
    attributes

    Custom key-value attributes.

    callback

    Result callback.

  • Decline a friendship request.

    Declaration

    Objective-C

    + (void)declineRequest:(nonnull LCFriendshipRequest *)request
                  callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func declineRequest(_ request: LCFriendshipRequest, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    request
    callback

    Result callback.

  • Block a friend by user id.

    Declaration

    Objective-C

    + (void)blockFriendWithUserId:(nonnull NSString *)userId
                         callback:
                             (nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func blockFriend(withUserId userId: String, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    userId

    The objectId of the user.

    callback

    Result callback.

  • Unblock a friend by user id.

    Declaration

    Objective-C

    + (void)unblockFriendWithUserId:(nonnull NSString *)userId
                           callback:
                               (nonnull void (^)(BOOL, NSError *_Nullable))callback;

    Swift

    class func unblockFriend(withUserId userId: String, callback: @escaping (Bool, Error?) -> Void)

    Parameters

    userId

    The objectId of the user.

    callback

    Result callback.