4.0.0-beta.5
Pre-release
Pre-release
⚠️ Breaking Changes from 4.0-beta.4
The severity of changes: 🟠 medium
-
The
CreateChatChannelButton
component was removed. The component acted only as a placeholder and the functionality should be always provided by the hosting app. For an example implementation see the Demo app. -
The payload of
AnyChatMessageAttachment
changed fromAny
toData
#1248. -
The user setting API was updated. It's now required to call one of the available
connect
methods onChatClient
afterChatClient
's instance is created in order to establish connection and set the current user.Migration tips:
If you were doing:
let client = ChatClient(config: config, tokenProvider: .static(token))
Now you should do:
let client = ChatClient(config: config) client.connectUser(userInfo: .init(id: userId), token: token)
Guest users before:
let client = ChatClient( config: config, tokenProvider: .guest( userId: userId, name: userName ) )
Now you should do:
let client = ChatClient(config: config) client.connectGuestUser(userInfo: .init(id: userId))
Anonymous users before:
let client = ChatClient(config: config, tokenProvider: .anonymous)
Now you should do:
let client = ChatClient(config: config) client.connectAnonymousUser()
If you use tokens that expire you probably do something like this:
let client = ChatClient( config: config, tokenProvider: .closure { client, completion in service.fetchToken { token in completion(token) } } )
Now you should do:
let client = ChatClient(config: config) service.fetchToken { token in client.connectUser(userInfo: .init(id: userId), token: token) } // `tokenProvider` property is used to reobtain a new token in case if the current one is expired client.tokenProvider = { completion in service.fetchToken { token in completion(token) } }
✅ Added
search(query:)
function toUserSearchController
to make a custom search with a query #1206queryForMentionSuggestionsSearch(typingMention:)
function toComposerVC
, users can override this function to customize mention search behavior #1206.contains
added toFilter
to be able to filter forteams
#1206
🔄 Changed
shouldConnectAutomatically
setting inChatConfig
, it now has no effect and all logic that used it now behaves like it was set totrue
.
🐞 Fixed
ConnectionController
fires itscontrollerDidChangeConnectionStatus
method only when the connection status actually changes #1207- Fix cancelled ephemeral (giphy) messages and deleted messages are visible in threads #1238
- Fix crash on missing
cid
value ofMessage
during local cache invalidation #1245 - Messages keep correct order if the local device time is different from the server time #1246