Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Stream Chat Depencency to v6 #34

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

JcMinarro
Copy link
Member

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
Member 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
Member 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

@@ -19,6 +19,7 @@ package io.getstream.avengerschat.initializer
import android.content.Context
import android.content.Intent
import androidx.startup.Initializer
import io.getstream.android.push.firebase.FirebasePushDeviceGenerator
Copy link
Member 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

backgroundSyncEnabled = true,
userPresence = true,
persistenceEnabled = true,
Copy link
Member 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
Member 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.

@@ -60,7 +60,8 @@ class StreamChatInitializer : Initializer<Unit> {
*/
ChatClient.Builder(context.getString(R.string.stream_api_key), context)
.notifications(createNotificationConfig(), createNotificationHandler(context))
.withPlugin(offlinePluginFactory)
.withPlugins(offlinePluginFactory, statePluginFactory)
Copy link
Member 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

@@ -17,7 +17,7 @@
package io.getstream.avengerschat.core.data.repository.dm

import androidx.annotation.WorkerThread
import io.getstream.chat.android.client.models.User
import io.getstream.chat.android.models.User
Copy link
Member 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
Member 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.

@@ -29,7 +29,7 @@
android:layout_width="match_parent"
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
Member 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
Member 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
Member 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.

1 participant