feat: Implement FCM token handling and dialog cache management; enhance user experience and performance

This commit is contained in:
k1ngsterr1
2026-01-17 05:53:27 +05:00
parent c9724b3bb7
commit 52ffc22763
9 changed files with 333 additions and 65 deletions

View File

@@ -51,32 +51,8 @@ class RosettaFirebaseMessagingService : FirebaseMessagingService() {
// Сохраняем токен локально
saveFcmToken(token)
// TODO: Отправляем токен на сервер если аккаунт уже залогинен
/*
serviceScope.launch {
try {
val accountManager = AccountManager(applicationContext)
val currentAccount = accountManager.getCurrentAccount()
if (currentAccount != null) {
Log.d(TAG, "📤 Sending FCM token to server for account: ${currentAccount.publicKey.take(10)}...")
// Отправляем через протокол
val packet = PacketPushToken().apply {
this.privateKey = CryptoManager.generatePrivateKeyHash(currentAccount.privateKey)
this.publicKey = currentAccount.publicKey
this.pushToken = token
this.platform = "android"
}
ProtocolManager.send(packet)
Log.d(TAG, "✅ FCM token sent to server")
}
} catch (e: Exception) {
Log.e(TAG, "❌ Error sending FCM token to server", e)
}
}
*/
// 📤 Токен будет отправлен на сервер после успешного логина в MainActivity
Log.d(TAG, "💾 FCM token saved. Will be sent to server after login.")
}
/**