新增聊天消息提醒

This commit is contained in:
2024-10-11 16:51:51 +08:00
parent 36739b1615
commit 81f90db1b1
15 changed files with 414 additions and 105 deletions

View File

@@ -1,6 +1,7 @@
package com.aiosman.riderpro
import android.content.Context
import android.content.Intent
import android.icu.util.Calendar
import android.icu.util.TimeZone
import android.util.Log
@@ -23,7 +24,6 @@ import com.tencent.imsdk.v2.V2TIMLogListener
import com.tencent.imsdk.v2.V2TIMManager
import com.tencent.imsdk.v2.V2TIMSDKConfig
import com.tencent.imsdk.v2.V2TIMUserFullInfo
import com.tencent.imsdk.v2.V2TIMValueCallback
import kotlinx.coroutines.CoroutineScope
import kotlin.coroutines.suspendCoroutine
@@ -66,8 +66,12 @@ object AppState {
val sign = accountService.getMyTrtcSign()
loginToTrtc(sign.userId, sign.sig)
updateTrtcUserProfile()
// 登录成功后启动TrtcService
context.startService(
Intent(context, TrtcService::class.java)
)
} catch (e: Exception) {
e.printStackTrace()
}
}
@@ -105,7 +109,7 @@ object AppState {
}
}
fun ReloadAppState() {
fun ReloadAppState(context: Context) {
// 重置动态列表页面
MomentViewModel.ResetModel()
// 重置我的页面
@@ -129,5 +133,13 @@ object AppState {
// 重置关注通知页面
IndexViewModel.ResetModel()
UserId = null
// 关闭 TrtcService
val trtcService = Intent(
context,
TrtcService::class.java
)
context.stopService(trtcService)
}
}