Chat SDK Initialization
Setup main application subclass
The best place to initialize the Chat SDK is in the onCreate
method of your Application
subclass.
If you don't already have this class, create it:
Register this class in your AndroidManifest.xml
:
Note: Sometimes people confuse the
onCreate
method in the main activity with theonCreate
method from theActivity
class. Although in some cases it is possible to setup the Chat SDK from inside an activity, it is not recommended.
Configure Chat SDK
Chat SDK offers two ways to configure the library - quick config and advanced. Quick allows you get the project up and running with a standard configuration.
Quick Start
Firebase
FireStream
XMPP
Pro Modules
If you want to use the licensed modules you will need to provide an identifier. That can be your Patreon ID, your Github Sponsors username, or the email address you used to buy the license at chatsdk.co.
Quick Start
You can use:
Builder
Advanced Configuration
Builder pattern
The Chat SDK and its modules use the builder pattern for configuration. You will always call builder()
then set your configuration then call build()
to finish.
Modules
The Chat SDK contains a number of optional modules. These can be added with the addModule
method. At the very minimum, you should activate the UIModule
and one of FirebaseModule
, XMPPModule
or FireStreamModule
.
Full example
Here is a default configuration.
Configuration options
The Chat SDK has many configuration options. Too many to list here. The best way to see what's available is by using auto-complete in Android Studio. After module.build().
press (control + enter) and the list of available options will appear. You can also (cmd + click) to inspect the Config
class and see a full list of the available options.
Last updated