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 (nonnull, nonatomic, readonly) Bit6Address *address

Declared In

Bit6Group.h

created

The creation timestamp of the sender.

@property (nonnull, 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:(nonnull 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 a Bit6Group object based on the Bit6Address indicated.

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

Parameters

address

Bit6Address of the group.

Return Value

a Bit6Group object for the Bit6Address indicated.

Declared In

Bit6Group.h

groupWithConversation:

Returns a Bit6Group object based on the Bit6Conversation indicated.

+ (nullable Bit6Group *)groupWithConversation:(nonnull 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:(nonnull Bit6Address *)address role:(nonnull NSString *)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: Bit6GroupMemberRole_Admin and Bit6GroupMemberRole_User.

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

inviteGroupMemberWithAddress:role:completion:

Invite an user to the group.

- (void)inviteGroupMemberWithAddress:(nonnull Bit6Address *)address role:(nonnull NSString *)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: Bit6GroupMemberRole_Admin and Bit6GroupMemberRole_User.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

inviteGroupMembersWithAddresses:roles:completion:

Invite users to the group.

- (void)inviteGroupMembersWithAddresses:(nonnull NSArray<Bit6Address*> *)addresses roles:(nonnull NSArray<NSString*> *)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: Bit6GroupMemberRole_Admin and Bit6GroupMemberRole_User.

completion

block to be called when the operation is completed.

Declared In

Bit6Group.h

kickGroupMember:completion:

Remove a member from the group.

- (void)kickGroupMember:(nonnull 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:(nonnull 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