Compare commits

..

2 Commits

Author SHA1 Message Date
0558a57942 Bump Android version to 1.4.0 (versionCode 42)
All checks were successful
Android Kernel Build / build (push) Successful in 19m30s
2026-04-01 00:22:03 +05:00
566e1f6c2e feat: add tokenType and deviceId to push notification packet
Support FCM/VOIP_APNS token types and device identification
for improved push notification routing.
2026-04-01 00:21:49 +05:00
3 changed files with 24 additions and 4 deletions

View File

@@ -23,8 +23,8 @@ val gitShortSha = safeGitOutput("rev-parse", "--short", "HEAD") ?: "unknown"
// ═══════════════════════════════════════════════════════════
// Rosetta versioning — bump here on each release
// ═══════════════════════════════════════════════════════════
val rosettaVersionName = "1.3.9"
val rosettaVersionCode = 41 // Increment on each release
val rosettaVersionName = "1.4.0"
val rosettaVersionCode = 42 // Increment on each release
val customWebRtcAar = file("libs/libwebrtc-custom.aar")
android {

View File

@@ -8,14 +8,24 @@ enum class PushNotificationAction(val value: Int) {
UNSUBSCRIBE(1)
}
/**
* Token type for push notifications.
*/
enum class PushTokenType(val value: Int) {
FCM(0),
VOIP_APNS(1)
}
/**
* Push Notification packet (ID: 0x10)
* Отправка FCM/APNS токена на сервер для push-уведомлений (новый формат)
* Совместим с React Native версией
* Отправка FCM/APNS токена на сервер для push-уведомлений
* Передаёт tokenType (fcm/voip) и deviceId
*/
class PacketPushNotification : Packet() {
var notificationsToken: String = ""
var action: PushNotificationAction = PushNotificationAction.SUBSCRIBE
var tokenType: PushTokenType = PushTokenType.FCM
var deviceId: String = ""
override fun getPacketId(): Int = 0x10
@@ -25,6 +35,11 @@ class PacketPushNotification : Packet() {
1 -> PushNotificationAction.UNSUBSCRIBE
else -> PushNotificationAction.SUBSCRIBE
}
tokenType = when (stream.readInt8()) {
1 -> PushTokenType.VOIP_APNS
else -> PushTokenType.FCM
}
deviceId = stream.readString()
}
override fun send(): Stream {
@@ -32,6 +47,8 @@ class PacketPushNotification : Packet() {
stream.writeInt16(getPacketId())
stream.writeString(notificationsToken)
stream.writeInt8(action.value)
stream.writeInt8(tokenType.value)
stream.writeString(deviceId)
return stream
}
}

View File

@@ -738,9 +738,12 @@ object ProtocolManager {
return
}
val deviceId = appContext?.let { getOrCreateDeviceId(it) } ?: ""
val subPacket = PacketPushNotification().apply {
notificationsToken = token
action = PushNotificationAction.SUBSCRIBE
tokenType = PushTokenType.FCM
this.deviceId = deviceId
}
send(subPacket)
lastSubscribedToken = token