Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Application/App/Sources/App/Handler/FCMTokenSyncHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class FCMTokenSyncHandler {
private struct SyncKey: Equatable {
let uid: String
let fcmToken: String
let code: PushLanguageCode
}

private let authService: AuthService
Expand Down Expand Up @@ -128,13 +129,25 @@ private extension FCMTokenSyncHandler {
return
}

let key = SyncKey(uid: uid, fcmToken: fcmToken)
let pushLanguageCode = PushLanguageCode(
identifier: Bundle.main.preferredLocalizations.first
)
let key = SyncKey(
uid: uid,
fcmToken: fcmToken,
code: pushLanguageCode
)
guard lastSyncedKey != key else {
logger.info("Skipping FCM token update because the token was already synced")
return
}

try await userService.updateFCMToken(fcmToken)
try await userService.updateFCMToken(
FCMTokenUpdate(
fcmToken: fcmToken,
code: pushLanguageCode
)
)
lastSyncedKey = key
}
}
51 changes: 51 additions & 0 deletions Application/App/Sources/Resource/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,57 @@
}
}
},
"push_notification_todo_due_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Todo Reminder"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "Todo 알림"
}
}
}
},
"push_notification_todo_due_tomorrow_format" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "%1$@ is due tomorrow."
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "'%1$@'의 마감일이 내일입니다."
}
}
}
},
"push_notification_todo_due_tomorrow_without_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "An untitled Todo is due tomorrow."
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "제목 없는 Todo의 마감일이 내일입니다."
}
}
}
},
"push_notifications_empty" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
Loading
Loading