We have made a lot of changes and improvements to the framework for v5. Some of these changes cause breaking changes. This document aims to summarize the changes and how to resolve them.
If you need support join us on our Discord Server. There we will provide help in real-time.
The ChatActivity is being deprecated in favour of a ChatKit implementation.
Before:
ChatSDK.hook().addHook(new Hook(data -> Completable.create(emitter -> {
// ...
emitter.onComplete();
})), HookEvent.MessageReceived);
After:
If you are adding synchronous code:
ChatSDK.hook().addHook(Hook.sync(data -> {
// ....
}), HookEvent.MessageReceived);
Or asynchronous code:
ChatSDK.hook().addHook(Hook.async(data -> Completable.create(emitter -> {
// ... Async code here
emitter.onComplete();
})), HookEvent.MessageReceived);
Before:
Completable forwardMessage(Message message, Thread thread);
After:
Completable forwardMessage(Thread thread, Message message);
Social login is complicated and error prone. We have had a lot of issues with third party login SDKs that change their API every few months and generate build problems with CocoaPods (Facebook and Twitter I'm looking at both of you). It also requires a lot of instructions to setup properly and the steps are always changing. For this reason, supporting social login takes a lot of time for relatively little benefit. Especially since this functionality is provided by Firebase UI.
So the bottom line is that if you want Social Login, you can either use Firebase UI. If you need custom social login, I recomment that you look at version 4.x of the project and migrate it to version 5.
co.chatsdk
package changed to sdk.chat
Solution
Update all instancea of co.chatsdk
in imports to sdk.chat
. For example:
import co.chatsdk.core.dao.Thread;
Becomes:
import sdk.chat.core.dao.Thread;
Issue
In the imports section at the top of the class the imports are red meaning they can't be found
Cause
The packages have been modified
Solution
In Android Studio open:
Preferences / Settings -> Editor -> General -> Auto Import
Check:
"Add unambiguous imports on the fly" and
"Optimize imports on the fly"
Delete the imports that can't be found and Android Studio will automatically reimport the classes
DisposableList
Issue
DisposableList
not found
Cause
DisposableList
has been removed in v5
Solution
Replace DisposableList
with DisposableMap
Thread
class not recognizedIssue
Methods not recognized on
Thread
Cause
Java thinks this is a Java thread not a chat thread
Solution
import sdk.chat.core.dao.Thread;
SimpleDraweeView
Issue
The app can't resolve the
SimpleDraweeView
class
Cause
We have replaced Fresco with Glide
Solution
Replace instances of SimpleDraweeView
with CircleImageView
. Use Glide to load the image from the URL
CrashReportingCompletableObserver;
Issue
import co.chatsdk.core.utils.CrashReportingCompletableObserver;
not found
Cause
This class has been removed
Solution
This has been removed. Usually we use this in the situation like:
.subscribe(new CrashReportingCompletableObserver());
This can be replaced with:
.subscribe(this)
If it is an Activity or a Fragment. If we are calling subscribe on something other than completable, you will have to call:
.ignoreElements().subscribe(this)
If it’s not an Activity or a Fragment use:
.subscribe(ChatSDK.events())
TextInputView
Issue
`import co.chatsdk.ui.chat.TextInputView; not found
Cause
This class has been replaced with the MessageInput
class
Solution
Delete the imports and use MessageInput
instead
Timber
Issue
`import timber.log.Timber; not found
Cause
Timber has been replaced with Logger
Solution
Delete the import and replaces instances of Timber
logging with Logger
logging i.e. Logger.debug("...")
ThreadEditDetailsActivity
Issue
import co.chatsdk.ui.threads.ThreadEditDetailsActivity;
not found
Cause
This class has been renamed to EditThreadActivity
Solution
Replace instances of ThreadEditDetailsActivity
with EditThreadActivity
The MessageListAdapter
has been removed in v5. We have replaced the old chat and thread view implementation with Chat Kit. Now the ThreadsFragment
uses a Chat Kit DialogsList and the ChatActivity
uses a MessagesList and a MessageInput for text entry. If you follow the links above you will find information on how to customize these elements.