Inherits from NSObject
Declared in Bit6Group.h

Overview

A Bit6Group object represents a group formed by several users.

Properties

address

The Bit6Address object associated with the sender.

@property (nonatomic, readonly) Bit6Address *address

Declared In

Bit6Group.h

conversation

The conversation the sender belongs to.

@property (nonatomic, copy, readonly) Bit6Conversation *conversation

Declared In

Bit6Group.h

created

The creation timestamp of the sender.

@property (nonatomic, copy, readonly) NSNumber *created

Declared In

Bit6Group.h

hasLeft

YES if the user has left the group.

@property (nonatomic, readonly) BOOL hasLeft

Declared In

Bit6Group.h

isAdmin

YES if the user role in the group is Admin.

@property (nonatomic, readonly) BOOL isAdmin

Declared In

Bit6Group.h

isPublic

YES if the group is public.

@property (nonatomic, readonly) BOOL isPublic

Declared In

Bit6Group.h

members

The Bit6GroupMember objects in the sender as a NSArray.

@property (nullable, nonatomic, copy, readonly) NSArray<Bit6GroupMember*> *members

Declared In

Bit6Group.h

metadata

The sender subject.

@property (nullable, nonatomic, copy, readonly) NSDictionary<NSString*id> *metadata

Declared In

Bit6Group.h

updated

The last updated timestamp of the sender.

@property (nullable, nonatomic, copy, readonly) NSNumber *updated

Declared In

Bit6Group.h

Class Methods

createGroupWithMetadata:completion:

Creates an empty group.

+ (void)createGroupWithMetadata:(nullable NSDictionary<NSString*,id> *)metadata completion:(nullable void ( ^ ) ( Bit6Group *_Nullable group , NSError *_Nullable error ))completion

Parameters

metadata

metadata for the new group. If provided it has to be able to be converted to JSON data (check by using +[NSJSONSerialization isValidJSONObject:])

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

createPublicGroupWithIdentifier:metadata:completion:

Creates an empty public group with the specified identifier.

+ (void)createPublicGroupWithIdentifier:(NSString *)identifier metadata:(nullable NSDictionary<NSString*,id> *)metadata completion:(nullable void ( ^ ) ( Bit6Group *_Nullable group , NSError *_Nullable error ))completion

Parameters

identifier

unique identifier to use.

metadata

metadata for the new group. If provided it has to be able to be converted to JSON data (check by using +[NSJSONSerialization isValidJSONObject:])

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

groupWithAddress:

Returns the Bit6Group object based on the Bit6Address indicated.

+ (nullable Bit6Group *)groupWithAddress:(Bit6Address *)address

Parameters

address

Bit6Address of the group.

Return Value

a Bit6Group object for the Bit6Address indicated.

Declared In

Bit6Group.h

groupWithConversation:

Returns the Bit6Group object based on the Bit6Conversation indicated.

+ (nullable Bit6Group *)groupWithConversation:(Bit6Conversation *)conversation

Parameters

conversation

Bit6Conversation linked to the group.

Return Value

a Bit6Group object for the Bit6Conversation indicated.

Declared In

Bit6Group.h

joinGroupWithAddress:role:completion:

Join a public group.

+ (void)joinGroupWithAddress:(Bit6Address *)address role:(Bit6GroupMemberRole)role completion:(nullable void ( ^ ) ( Bit6Group *_Nullable group , NSError *_Nullable error ))completion

Parameters

address

Bit6Address of the group to join.

role

requested role in the group. There are constants available to use: Bit6GroupMemberRoleAdmin and Bit6GroupMemberRoleUser.

completion

block to be called when the operation is completed.

Discussion

Note: You can check if a group is public by using [Bit6Group isPublic]

Declared In

Bit6Group.h

Instance Methods

init

Unavailable init

- (instancetype)init

Return Value

a new instance of the class.

Declared In

Bit6Group.h

inviteGroupMemberWithAddress:role:completion:

Invite an user to the group.

- (void)inviteGroupMemberWithAddress:(Bit6Address *)address role:(Bit6GroupMemberRole)role completion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

address

Bit6Address indicating the user to invite.

role

requested role to assign to the user invited to the group. There are constants available to use: Bit6GroupMemberRoleAdmin and Bit6GroupMemberRoleUser.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

inviteGroupMembersWithAddresses:role:completion:

Invite users to the group.

- (void)inviteGroupMembersWithAddresses:(NSArray<Bit6Address*> *)addresses role:(Bit6GroupMemberRole)role completion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

addresses

array of Bit6Address indicating the users to invite.

role

role to assign to the users invited to the group. There are constants available to use: Bit6GroupMemberRoleAdmin and Bit6GroupMemberRoleUser.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

inviteGroupMembersWithAddresses:roles:completion:

Invite users to the group.

- (void)inviteGroupMembersWithAddresses:(NSArray<Bit6Address*> *)addresses roles:(NSArray<Bit6GroupMemberRole> *)roles completion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

addresses

array of Bit6Address indicating the users to invite.

roles

array of requested roles to assign to the users invited to the group. There are constants available to use: Bit6GroupMemberRoleAdmin and Bit6GroupMemberRoleUser.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

kickGroupMember:completion:

Remove a member from the group.

- (void)kickGroupMember:(Bit6GroupMember *)member completion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

member

member to be removed from the group.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

leaveGroupWithCompletion:

Abandon the sender. Updates related to the sender won’t be received anymore.

- (void)leaveGroupWithCompletion:(nullable void ( ^ ) ( NSError *_Nullable error ))completion

Parameters

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

loadMembersListWithCompletion:

Refreshes the members of the sender.

- (nullable NSArray<Bit6GroupMember*> *)loadMembersListWithCompletion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

completion

block to be called when the operation is completed.

Return Value

current members list of the sender.

Declared In

Bit6Group.h

setMetadata:completion:

Sets the metadata for the sender.

- (void)setMetadata:(NSDictionary<NSString*,id> *)metadata completion:(nullable void ( ^ ) ( NSError *_Nullable error ))completion

Parameters

metadata

new metadata for the sender. If provided it has to be able to be converted to JSON data (check by using +[NSJSONSerialization isValidJSONObject:])

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

setRole:forMember:completion:

Change the group member role.

- (void)setRole:(Bit6GroupMemberRole)role forMember:(Bit6GroupMember *)member completion:(nullable void ( ^ ) ( NSArray<Bit6GroupMember*> *_Nullable members , NSError *_Nullable error ))completion

Parameters

role

new role for the group member.

member

member to modify.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h