TUIKit Android Compose.login method of LoginStore to log in.@Composable component. Before testing search, add some sample data locally, such as contacts, messages, and group chats; otherwise, no results will be returned.sdkAppID: Your sdkAppID from the console.userID: The operator's userID (for example, user1 from Quick Start).userSig: The operator's userSig (for example, user1's userSig from Quick Start).SearchScreen to trigger a search. Sample code:// SearchDemoActivity.ktimport android.content.Intentimport android.os.Bundleimport android.view.WindowManagerimport androidx.activity.compose.setContentimport androidx.appcompat.app.AppCompatActivityimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.foundation.layout.navigationBarsPaddingimport androidx.compose.foundation.layout.statusBarsPaddingimport androidx.compose.ui.Modifierimport io.trtc.tuikit.atomicx.basecomponent.theme.LocalThemeimport io.trtc.tuikit.atomicx.search.ui.SearchScreenimport io.trtc.tuikit.atomicxcore.api.CompletionHandlerimport io.trtc.tuikit.atomicxcore.api.login.LoginStoreclass SearchDemoActivity : AppCompatActivity() {private val sdkAppID: Int = 1234567890 // TODO: Fill in the 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)window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE orWindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)login()}private fun login() {LoginStore.shared.login(this, sdkAppID, userID, userSig, object : CompletionHandler {override fun onSuccess() {showSearchPage()}override fun onFailure(code: Int, desc: String) {// Handle login failure}})}private fun showSearchPage() {setContent {val colors = LocalTheme.current.colorsSearchScreen(modifier = Modifier.background(colors.bgColorOperate).fillMaxSize().statusBarsPadding().navigationBarsPadding(),onBack = { finish() },onContactSelect = { friendSearchInfo ->// Handle friend search resultval conversationID = "c2c_${friendSearchInfo.userID}"// Navigate to chat page with conversationID},onGroupSelect = { groupSearchInfo ->// Handle group search resultval conversationID = "group_${groupSearchInfo.groupID}"// Navigate to chat page with conversationID},onConversationSelect = { messageSearchResultItem ->// Handle conversation search resultval conversationID = messageSearchResultItem.conversationID// Navigate to chat page with conversationID},onMessageSelect = { messageInfo ->// Handle message search result (navigate to chat and locate message)// Navigate to chat page with conversationID and locateMessage})}}}

fileName parameter when creating the message to make it searchable. If fileName is not specified, the file name is extracted from filePath, and both are stored locally and on the server.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan