Created
June 29, 2020 18:45
-
-
Save jetaggart/9246f417c477004eb63a5eed702e33fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/app/src/main/java/io/getstream/thestream/services/ChatService.kt:48 | |
fun createGroupChannel(channelName: String) { | |
val channelId = channelName | |
.toLowerCase(Locale.getDefault()) | |
.replace("\\s".toRegex(), "-") | |
val result = client | |
.createChannel( | |
ModelType.channel_livestream, | |
channelId, | |
mapOf( | |
"name" to channelName, | |
"image" to "https://robohash.org/${channelId}.png" | |
) | |
) | |
.execute() | |
if (result.isError) { | |
throw result.error() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment