Skip to content

Commit 5b37b4f

Browse files
committed
happy client level tests
1 parent 7899d4f commit 5b37b4f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

samplekotlin/src/main/java/com/example/chattutorial/MainActivity.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
)

0 commit comments

Comments
 (0)