Skip to content

Conversation

@JcMinarro
Copy link
Contributor

Upgrade App to the new Stream Chat V6

Comment on lines +72 to 73
stream-state = { module = "io.getstream:stream-chat-android-state", version.ref = "stream" }
stream-offline = { module = "io.getstream:stream-chat-android-offline", version.ref = "stream" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offline artifact has been split into:
stream-chat-android-offline -> Responsible for data persistence on the device
stream-chat-android-state -> Responsible to provide reactive data

stream-offline = { module = "io.getstream:stream-chat-android-offline", version.ref = "stream" }
stream-ui-components = { module = "io.getstream:stream-chat-android-ui-components", version.ref = "stream" }
stream-firebase = { module = "io.getstream:stream-chat-android-pushprovider-firebase", version.ref = "stream" }
stream-firebase = { module = "io.getstream:stream-android-push-firebase", version.ref = "streamPush" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push artifact has been extracted from the principal repository, but the implementation is the same

import android.content.Context
import android.content.Intent
import androidx.startup.Initializer
import io.getstream.android.push.firebase.FirebasePushDeviceGenerator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Push Classes" are into a new artifact with different package name

config = StatePluginConfig(
backgroundSyncEnabled = true,
userPresence = true,
persistenceEnabled = true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever the Offline Plugin is used, the persistence is enabled. This flag is not needed anymore

backgroundSyncEnabled = true,
userPresence = true,
persistenceEnabled = true,
uploadAttachmentsNetworkType = UploadAttachmentsNetworkType.NOT_ROAMING
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration is added to the ChatClient, it is not a configuration of the offline plugin anymore.

ChatClient.Builder(context.getString(R.string.stream_api_key), context)
.notifications(createNotificationConfig(), createNotificationHandler(context))
.withPlugin(offlinePluginFactory)
.withPlugins(offlinePluginFactory, statePluginFactory)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both plugins are included


import androidx.annotation.WorkerThread
import io.getstream.chat.android.client.models.User
import io.getstream.chat.android.models.User
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Models has been moved to a different package

Comment on lines 63 to +64
result.onSuccessSuspend {
emit(result.data())
emit(it)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result class has been improved and extracted to a different artifact.
It improves how it is used taking advantage of Kotlin language.

android:layout_height="match_parent">

<io.getstream.chat.android.ui.channel.list.header.ChannelListHeaderView
<io.getstream.chat.android.ui.feature.channels.header.ChannelListHeaderView
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some Views have been moved to other package names to keep the parity with the compose artifact

/>

<io.getstream.chat.android.ui.message.input.MessageInputView
<io.getstream.chat.android.ui.feature.messages.composer.MessageComposerView
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has been renamed to keep the parity with the compose artifact

@JcMinarro
Copy link
Contributor Author

Do not merge this PR yet.
We need to release a V6 version outside of the beta before to merge this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants