Skip to content

Commit b8c6a56

Browse files
authored
Merge pull request #41 from GetStream/feature/update-user
Use new tutorial-droid user
2 parents 906c3e2 + 84319f0 commit b8c6a56

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

samplejava/src/main/java/com/example/chattutorialjava/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
3737

3838
// Step 2 - Authenticate and connect the user
3939
User user = new User();
40-
user.setId("summer-brook-2");
41-
user.getExtraData().put("name", "Paranoid Android");
40+
user.setId("tutorial-droid");
41+
user.getExtraData().put("name", "Tutorial Droid");
4242
user.getExtraData().put("image", "https://bit.ly/2TIt8NR");
4343

4444
client.connectUser(
4545
user,
46-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3VtbWVyLWJyb29rLTIifQ.CzyOx8kgrc61qVbzWvhV1WD3KPEo5ZFZH-326hIdKz0"
46+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidHV0b3JpYWwtZHJvaWQifQ.NhEr0hP9W9nwqV7ZkdShxvi02C5PR7SJE7Cs4y7kyqg"
4747
).enqueue();
4848

4949
// Step 3 - Set the channel list filter and order

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ class MainActivity : AppCompatActivity() {
2727

2828
// Step 1 - Set up the client for API calls, the domain for offline storage and the UI components
2929
val client = ChatClient.Builder("b67pax5b2wdq", applicationContext)
30-
.logLevel(ChatLogLevel.ALL)
31-
.build()
30+
.logLevel(ChatLogLevel.ALL)
31+
.build()
3232
ChatDomain.Builder(client, applicationContext).build()
3333
ChatUI.Builder(applicationContext).build()
3434

3535
// Step 2 - Authenticate and connect the user
3636
val user = User(
37-
id = "summer-brook-2",
38-
extraData = mutableMapOf(
39-
"name" to "Paranoid Android",
40-
"image" to "https://bit.ly/2TIt8NR",
41-
),
37+
id = "tutorial-droid",
38+
extraData = mutableMapOf(
39+
"name" to "Tutorial Droid",
40+
"image" to "https://bit.ly/2TIt8NR",
41+
),
4242
)
4343
client.connectUser(
44-
user = user,
45-
token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3VtbWVyLWJyb29rLTIifQ.CzyOx8kgrc61qVbzWvhV1WD3KPEo5ZFZH-326hIdKz0"
44+
user = user,
45+
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidHV0b3JpYWwtZHJvaWQifQ.NhEr0hP9W9nwqV7ZkdShxvi02C5PR7SJE7Cs4y7kyqg"
4646
).enqueue()
4747

4848
// Step 3 - Set the channel list filter and order
4949
// This can be read as requiring only channels whose "type" is "messaging" AND
5050
// whose "members" include our "user.id"
5151
val filter = Filters.and(
52-
Filters.eq("type", "messaging"),
53-
Filters.`in`("members", listOf(user.id))
52+
Filters.eq("type", "messaging"),
53+
Filters.`in`("members", listOf(user.id))
5454
)
5555
val viewModelFactory = ChannelListViewModelFactory(filter, ChannelListViewModel.DEFAULT_SORT)
5656
val viewModel: ChannelListViewModel by viewModels { viewModelFactory }

0 commit comments

Comments
 (0)