TUIKit Compose.login interface of LoginStore to authenticate the component.UserPicker) and Group settings (GroupSettingsBottomSheet) in a single flow. Once you create a Group, you can start sending messages to it.sdkAppID: The sdkAppID you obtained earlier.userID: The user ID of the operator, such as user1 created in Quick Start.userSig: The userSig of the operator, which is the userSig for user1 as described in Quick Start.// CreateGroupActivity.ktimport android.os.Bundleimport androidx.activity.compose.setContentimport androidx.appcompat.app.AppCompatActivityimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport io.trtc.tuikit.atomicx.contactlist.ui.addnewchat.AddNewChatBottomSheetimport io.trtc.tuikit.atomicx.contactlist.viewmodels.ChatTypeimport io.trtc.tuikit.atomicxcore.api.CompletionHandlerimport io.trtc.tuikit.atomicxcore.api.login.LoginStoreclass CreateGroupActivity : AppCompatActivity() {private val sdkAppID: Int = 1234567890 // TODO: Fill in your sdkAppID hereprivate val userID = "" // TODO: Fill in your userID hereprivate val userSig = "" // TODO: Fill in your generated userSig hereoverride fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)login()}private fun login() {LoginStore.shared.login(this, sdkAppID, userID, userSig, object : CompletionHandler {override fun onSuccess() {showCreateGroupPage()}override fun onFailure(code: Int, desc: String) {// Handle login failure}})}private fun showCreateGroupPage() {setContent {var showSheet by remember { mutableStateOf(true) }var createdConversationID by remember { mutableStateOf<String?>(null) }if (createdConversationID != null) {// Group created successfully, navigate to chat page// Use createdConversationID to open ChatPage}if (showSheet) {AddNewChatBottomSheet(chatType = ChatType.GROUP,onDismiss = { showSheet = false },onCreateChat = { conversationId ->showSheet = falsecreatedConversationID = conversationId})}}}}
Search Contacts | Send Request |
![]() | ![]() |
フィードバック