
Initialization
TheCometChat.init() method now takes an additional parameter. This parameter is an object of the AppSettings class. This object can be created by using the AppSettingsBuilder class. The AppSettings class provides the CometChat SDK with the below 2 details:
- Region of your app: The region of your app is the code of the region your app is hosted in. Currently, this can only hold one of the below two values: a. eu - If your app is hosted in Europe b. us - If your app is hosted in the United States of America.
- Presence Subscription.
- Swift
Text Message Constructor
Since the only possible valid value themessageType parameter could take in the constructor was CometChatConstants.MESSAGE_TYPE_TEXT(text), we have excluded the messageType parameter from the TextMessage constructor.
- Swift
Mark a Message as Read
In v1.x, for marking the messages as read, every message had to marked as read individually using theCometChat.markMessageAsRead() which took the entire message object as the input parameter.
Starting v2.0, the method name has been changed to markAsRead() which takes the messageId,receiverId, and receiverType as input. This method, will mark all the messages as read. For more information, please check the mark messages as read guide.
- Swift
Retrieve List of Friends
In v1.x to fetch only friends, you had to enable the Show only friends setting in the CometChat Dashboard. Starting v2.x, we have added a method in the UsersRequestBuilder to fetch only friends. This method acceptsboolean and fetches only friends if it is set to true else it fetches all the users. By default it is set to false. For more information, please check the retrieve list of users guide.
- Swift