Skip to content

Commit

Permalink
Merge pull request #8 from QuickBlox/2.21.0
Browse files Browse the repository at this point in the history
2.21.0
  • Loading branch information
IlliaChemolosov authored Dec 11, 2024
2 parents 0006603 + d1f518c commit fcb3ad5
Show file tree
Hide file tree
Showing 71 changed files with 432 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ DerivedData
.idea/
Pods/
Podfile.lock
.swiftpm
Package.resolved
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

18 changes: 9 additions & 9 deletions Quickblox.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@
<key>BinaryPath</key>
<string>Quickblox.framework/Quickblox</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Quickblox.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Quickblox.framework/Quickblox</string>
<string>Quickblox.framework/Versions/A/Quickblox</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>Quickblox.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>Quickblox.framework/Versions/A/Quickblox</string>
<string>Quickblox.framework/Quickblox</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Quickblox.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -50,7 +50,7 @@
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ typedef void(^QBOnlineUsersBlock)(NSMutableArray <NSNumber *> * _Nullable online
- (id)init NS_UNAVAILABLE;
+ (id)new NS_UNAVAILABLE;

/// Creates a dialog instance.
/// @param type The type of the dialog. See `QBChatDialogType`.
/// @return An instance of `QBChatDialog`.
+ (instancetype)create:(QBChatDialogType)type;

/**
Init with dialog ID and type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, assign, readonly) BOOL carbon;

/**
* Message date sent.
*/
/// The date when the message was sent.
///
/// This property is automatically populated when calling the `dialog.send(message)` method.
/// To use a custom value for this property, the `setDateSentEnforced:` method should be used.
@property (nonatomic, strong, nullable) NSDate *dateSent;

/// Sets a custom sent date for the message.
///
/// @param dateSent A non-null date to set as the sent time for the message.
///
/// This method allows specifying a custom value for the sent date instead of the
/// automatically populated date from the `dialog.send(message)` method.
- (void)setDateSentEnforced:(NSDate *)dateSent;

/**
Message custom parameters. Don't use 'body' & 'delay' as keys for parameters.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ typedef void(^qb_response_unread_messages_block_t) (QBResponse *response, NSUInt
typedef void(^qb_response_count_block_t) (QBResponse *response, NSUInteger count);

NS_ASSUME_NONNULL_END

/**Completion with response deleted dialogs ids, not found dialogs ids and wrong permissions dialogs ids. */
typedef void(^qb_response_delete_dialog_completion_t)
(NSArray<NSString *>* _Nullable deletedIds,
NSArray<NSString *>* _Nullable notFoundIds,
NSArray<NSString *> * _Nullable wrongPermissionsIds,
NSError * _Nullable error);

/**Completion with response array of chat messages for page. */
typedef void(^qb_response_messages_completion_t)
(NSArray<QBChatMessage *>* _Nullable messages,
QBResponsePage * _Nullable page,
NSError * _Nullable error);
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ typedef void(^qb_response_user_block_t)(QBResponse *response, QBUUser *tUser);
@return An instance of QBUUser for cancel operation mainly.
*/
+ (void)login:(NSString *)login
password:(NSString *)password
completion:(void (^) (QBUUser * _Nullable tUser, NSError * _Nullable error))completion;
password:(NSString *)password
completion:(void (^) (QBUUser * _Nullable tUser,
NSError * _Nullable error))completion;

/**
User LogIn with email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ NS_ASSUME_NONNULL_BEGIN
extendedRequest:(nullable NSDictionary<NSString *, NSString *> *)extendedRequest
successBlock:(nullable qb_response_dialogs_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Creates a chat dialog.
/// @param dialog The chat dialog instance to be created.
/// @param completion A block called upon completion of the operation.
/// - `tDialog`: The created chat dialog instance, or `nil` if an error occurred.
/// - `error`: An error object describing the failure, or `nil` if the operation succeeded.
+ (void)createDialog:(QBChatDialog *)dialog
completion:(void (^)(QBChatDialog * _Nullable tDialog,
NSError * _Nullable error))completion;

/**
Create chat dialog
Expand All @@ -53,6 +63,23 @@ NS_ASSUME_NONNULL_BEGIN
successBlock:(nullable qb_response_dialog_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Deletes dialogs with specified IDs.
///
/// @param dialogIDs A set of dialog IDs to delete.
/// @param forAllUsers Specifies whether the dialog should be deleted for all users.
/// Pass `YES` to delete for all users (current user must be the owner),
/// or `NO` to delete only for the current user.
/// @param completion A block called upon completion of the request, containing:
/// - `deletedIds`: An array of dialog IDs successfully deleted.
/// - `notFoundIds`: An array of dialog IDs that were not found.
/// - `wrongPermissionsIds`: An array of dialog IDs for which the current user lacks the necessary permissions.
/// - `error`: An error object if the request fails, or `nil` if it succeeds.
///
/// @discussion When passing `YES` to `forAllUsers`, the current user must be the owner of the dialog.
/// If the user is not the owner, the request will fail.
+ (void)deleteDialogsWithIDs:(NSSet<NSString *> *)dialogIDs
forAllUsers:(BOOL)forAllUsers
completion:(qb_response_delete_dialog_completion_t)completion;
/**
Delete dialogs
Expand All @@ -70,6 +97,27 @@ NS_ASSUME_NONNULL_BEGIN
successBlock:(nullable qb_response_delete_dialog_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Retrieves chat messages for a specific dialog and page.
///
/// - Parameters:
/// - dialogID: The unique identifier of the dialog.
/// - extendedParameters: A dictionary of additional request parameters. Use the key `@"mark_as_read"` with value `@"0"`
/// to prevent marking messages as read upon retrieval.
/// - page: An optional instance of `QBResponsePage` specifying the pagination details.
/// - completion: A completion block that returns an array of `QBChatMessage` objects for the specified page,
/// the response page details, and an error object if the operation fails.
///
/// By default, all messages retrieved from the server are marked as read. To change this behavior,
/// include the `@"mark_as_read"` parameter in the `extendedParameters` dictionary.
///
/// ```objective-c
/// [extendedParameters setObject:@"0" forKey:@"mark_as_read"];
/// ```
+ (void)messagesWithDialogID:(NSString *)dialogID
extendedRequest:(nullable NSDictionary<NSString *, NSString *> *) extendedParameters
forPage:(nullable QBResponsePage *)page
completion:(nullable qb_response_messages_completion_t)completion;

/**
Retrieve chat messages within particular dialog for page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

NS_ASSUME_NONNULL_BEGIN

/// Framework version 2.20.0
/// Framework version 2.21.0
FOUNDATION_EXPORT NSString * const QuickbloxFrameworkVersion;

@interface Quickblox : NSObject
Expand Down
Binary file modified Quickblox.xcframework/ios-arm64/Quickblox.framework/Info.plist
Binary file not shown.
Binary file modified Quickblox.xcframework/ios-arm64/Quickblox.framework/Quickblox
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ typedef void(^QBOnlineUsersBlock)(NSMutableArray <NSNumber *> * _Nullable online
- (id)init NS_UNAVAILABLE;
+ (id)new NS_UNAVAILABLE;

/// Creates a dialog instance.
/// @param type The type of the dialog. See `QBChatDialogType`.
/// @return An instance of `QBChatDialog`.
+ (instancetype)create:(QBChatDialogType)type;

/**
Init with dialog ID and type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, assign, readonly) BOOL carbon;

/**
* Message date sent.
*/
/// The date when the message was sent.
///
/// This property is automatically populated when calling the `dialog.send(message)` method.
/// To use a custom value for this property, the `setDateSentEnforced:` method should be used.
@property (nonatomic, strong, nullable) NSDate *dateSent;

/// Sets a custom sent date for the message.
///
/// @param dateSent A non-null date to set as the sent time for the message.
///
/// This method allows specifying a custom value for the sent date instead of the
/// automatically populated date from the `dialog.send(message)` method.
- (void)setDateSentEnforced:(NSDate *)dateSent;

/**
Message custom parameters. Don't use 'body' & 'delay' as keys for parameters.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ typedef void(^qb_response_unread_messages_block_t) (QBResponse *response, NSUInt
typedef void(^qb_response_count_block_t) (QBResponse *response, NSUInteger count);

NS_ASSUME_NONNULL_END

/**Completion with response deleted dialogs ids, not found dialogs ids and wrong permissions dialogs ids. */
typedef void(^qb_response_delete_dialog_completion_t)
(NSArray<NSString *>* _Nullable deletedIds,
NSArray<NSString *>* _Nullable notFoundIds,
NSArray<NSString *> * _Nullable wrongPermissionsIds,
NSError * _Nullable error);

/**Completion with response array of chat messages for page. */
typedef void(^qb_response_messages_completion_t)
(NSArray<QBChatMessage *>* _Nullable messages,
QBResponsePage * _Nullable page,
NSError * _Nullable error);
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ typedef void(^qb_response_user_block_t)(QBResponse *response, QBUUser *tUser);
@return An instance of QBUUser for cancel operation mainly.
*/
+ (void)login:(NSString *)login
password:(NSString *)password
completion:(void (^) (QBUUser * _Nullable tUser, NSError * _Nullable error))completion;
password:(NSString *)password
completion:(void (^) (QBUUser * _Nullable tUser,
NSError * _Nullable error))completion;

/**
User LogIn with email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ NS_ASSUME_NONNULL_BEGIN
extendedRequest:(nullable NSDictionary<NSString *, NSString *> *)extendedRequest
successBlock:(nullable qb_response_dialogs_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Creates a chat dialog.
/// @param dialog The chat dialog instance to be created.
/// @param completion A block called upon completion of the operation.
/// - `tDialog`: The created chat dialog instance, or `nil` if an error occurred.
/// - `error`: An error object describing the failure, or `nil` if the operation succeeded.
+ (void)createDialog:(QBChatDialog *)dialog
completion:(void (^)(QBChatDialog * _Nullable tDialog,
NSError * _Nullable error))completion;

/**
Create chat dialog
Expand All @@ -53,6 +63,23 @@ NS_ASSUME_NONNULL_BEGIN
successBlock:(nullable qb_response_dialog_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Deletes dialogs with specified IDs.
///
/// @param dialogIDs A set of dialog IDs to delete.
/// @param forAllUsers Specifies whether the dialog should be deleted for all users.
/// Pass `YES` to delete for all users (current user must be the owner),
/// or `NO` to delete only for the current user.
/// @param completion A block called upon completion of the request, containing:
/// - `deletedIds`: An array of dialog IDs successfully deleted.
/// - `notFoundIds`: An array of dialog IDs that were not found.
/// - `wrongPermissionsIds`: An array of dialog IDs for which the current user lacks the necessary permissions.
/// - `error`: An error object if the request fails, or `nil` if it succeeds.
///
/// @discussion When passing `YES` to `forAllUsers`, the current user must be the owner of the dialog.
/// If the user is not the owner, the request will fail.
+ (void)deleteDialogsWithIDs:(NSSet<NSString *> *)dialogIDs
forAllUsers:(BOOL)forAllUsers
completion:(qb_response_delete_dialog_completion_t)completion;
/**
Delete dialogs
Expand All @@ -70,6 +97,27 @@ NS_ASSUME_NONNULL_BEGIN
successBlock:(nullable qb_response_delete_dialog_block_t)successBlock
errorBlock:(nullable qb_response_block_t)errorBlock;

/// Retrieves chat messages for a specific dialog and page.
///
/// - Parameters:
/// - dialogID: The unique identifier of the dialog.
/// - extendedParameters: A dictionary of additional request parameters. Use the key `@"mark_as_read"` with value `@"0"`
/// to prevent marking messages as read upon retrieval.
/// - page: An optional instance of `QBResponsePage` specifying the pagination details.
/// - completion: A completion block that returns an array of `QBChatMessage` objects for the specified page,
/// the response page details, and an error object if the operation fails.
///
/// By default, all messages retrieved from the server are marked as read. To change this behavior,
/// include the `@"mark_as_read"` parameter in the `extendedParameters` dictionary.
///
/// ```objective-c
/// [extendedParameters setObject:@"0" forKey:@"mark_as_read"];
/// ```
+ (void)messagesWithDialogID:(NSString *)dialogID
extendedRequest:(nullable NSDictionary<NSString *, NSString *> *) extendedParameters
forPage:(nullable QBResponsePage *)page
completion:(nullable qb_response_messages_completion_t)completion;

/**
Retrieve chat messages within particular dialog for page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

NS_ASSUME_NONNULL_BEGIN

/// Framework version 2.20.0
/// Framework version 2.21.0
FOUNDATION_EXPORT NSString * const QuickbloxFrameworkVersion;

@interface Quickblox : NSObject
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>23F79</string>
<string>24B91</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -29,19 +29,19 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>21F77</string>
<string>24B75</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>14.5</string>
<string>15.1</string>
<key>DTSDKBuild</key>
<string>23F73</string>
<string>24B75</string>
<key>DTSDKName</key>
<string>macosx14.5</string>
<string>macosx15.1</string>
<key>DTXcode</key>
<string>1540</string>
<string>1610</string>
<key>DTXcodeBuild</key>
<string>15F31d</string>
<string>16B40</string>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
<key>UIDeviceFamily</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fcb3ad5

Please sign in to comment.