Initialization

To initialize the SDK, you need to add the following activities to the AndroidManifest.xml file:

Copy
Copied
<activity
    android:name="com.sinch.chat.sdk.SinchChatActivity"
    android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
/>
<activity
    android:name="com.sinch.chat.sdk.SinchInboxChatActivity"
    android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
/>

Then we need to call the initialize method. Since we want to initialize the SDK as soon as possible, the best place to do this is in the MainActivity.kt file, in the onCreate method. It looks something like this:

Copy
Copied
override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            SinchChatSDK.initialize(applicationContext)
        }
    }
Note:

To learn how to initaizlie push notifications, see the Push notification section.

After initializing, you must set the identity.

We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.