File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
samplekotlin/src/main/java/com/example/chattutorial Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,18 @@ class MainActivity : AppCompatActivity(R.layout.activity_main) {
2121 super .onCreate(savedInstanceState)
2222
2323 // step 1 - setup the client for API calls, the chatDomain for offline storage and the UX components
24- val client = ChatClient .Builder (" b67pax5b2wdq" , applicationContext).logLevel(ChatLogLevel .ALL ).build()
25- val domain = ChatDomain .Builder (client).build()
26- val ux = ChatUX .Builder (client, domain).build()
24+ // val client = ChatClient.Builder("b67pax5b2wdq", applicationContext).logLevel(ChatLogLevel.ALL).build()
25+ // val domain = ChatDomain.Builder(client).build()
26+ // val ux = ChatUX.Builder(client, domain).build()
27+
28+ Chat .Builder (" b67pax5b2wdq" , applicationContext).apply { offlineEnabled= true }.build()
2729
2830 val user = User (" summer-brook-2" ).apply {
2931 extraData[" name" ] = " Paranoid Android"
3032 extraData[" image" ] = " https://bit.ly/2TIt8NR"
3133 }
3234 // step 2 - Authenticate and connect the user
33- client .setUser(
35+ ChatClient .instance() .setUser(
3436 user = user,
3537 token = " eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3VtbWVyLWJyb29rLTIifQ.CzyOx8kgrc61qVbzWvhV1WD3KPEo5ZFZH-326hIdKz0"
3638 )
You can’t perform that action at this time.
0 commit comments