From 130935c01dc81f92096c6880549f9e597166795d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sat, 14 Mar 2026 21:20:45 +0100 Subject: [PATCH] Use ToastView for notification setup --- .../Connection/InboundNearbyConnection.swift | 86 +- .../MirroredNotificationSupport.swift | 2 - .../Connection/NearbyConnectionManager.swift | 8 +- NearbyShare/Model/DataModel.swift | 7 + .../Model/Protobuf/wire_format.pb.swift | 34 +- .../Model/ProtobufSource/wire_format.proto | 4 +- NearbyShare/Util/TrustStore.swift | 59 +- QuickDrop/Localizable.xcstrings | 1400 ++++++++++++++++- QuickDrop/Util/ErrorAlertHandler.swift | 3 +- QuickDrop/View/Toast/QuickDropToastView.swift | 54 +- QuickDrop/ViewModel/ReceiveModel.swift | 63 +- 11 files changed, 1674 insertions(+), 46 deletions(-) diff --git a/NearbyShare/Connection/InboundNearbyConnection.swift b/NearbyShare/Connection/InboundNearbyConnection.swift index 1109af5..ae29d92 100644 --- a/NearbyShare/Connection/InboundNearbyConnection.swift +++ b/NearbyShare/Connection/InboundNearbyConnection.swift @@ -32,11 +32,11 @@ class InboundNearbyConnection: NearbyConnection { private var isAuthenticated = false private var peerCertificate: Sharing_Nearby_PublicCertificate? = nil private var mirroredNotificationMetadata: Sharing_Nearby_MirroredNotificationMetadata? + private var isNotificationSyncSetupPing = false var isPlainTextTransfer = false - private var isMirroredNotificationTransfer = false + var isMirroredNotificationTransfer = false var wasUserRejected = false - var shouldSuppressAppDelegates = false var delegate: InboundNearbyConnectionDelegate? enum State { @@ -511,6 +511,7 @@ class InboundNearbyConnection: NearbyConnection { if peerPublicKey.verify(signature: signature, msg: authKeyData) { log("[InboundNearbyConnection \(self.id)] Paired key authentication successful.") + self.peerCertificate = trustedCert try sendPairedKeyResult(status: .success) isAuthenticated = true } else { @@ -608,13 +609,65 @@ class InboundNearbyConnection: NearbyConnection { if frame.v1.introduction.hasMirroredNotificationMetadata { isMirroredNotificationTransfer = true mirroredNotificationMetadata = frame.v1.introduction.mirroredNotificationMetadata - shouldSuppressAppDelegates = true + isNotificationSyncSetupPing = mirroredNotificationMetadata?.setupRequest == true + let setupSuccessNotice = mirroredNotificationMetadata?.hasSetupPinHash == true - if !isAuthenticated { - guard let device = self.remoteDeviceInfo else { + guard let device = self.remoteDeviceInfo else { + self.rejectTransfer(with: .reject) + return + } + + if !isAuthenticated && !isNotificationSyncSetupPing && !setupSuccessNotice { + self.lastError = NearbyError.notificationSyncNotTrusted + self.rejectTransfer(with: .reject, markAsUserRejected: false) + return + } + + if setupSuccessNotice { + guard let peerCertificate = peerCertificate else { self.rejectTransfer(with: .reject) return } + + let trustedData = TrustStore.shared.findTrustedKey(for: peerCertificate.secretID) + if let trustedData { + guard let currentData = try? peerCertificate.serializedData(), + currentData == trustedData else { + self.rejectTransfer(with: .reject) + return + } + DispatchQueue.main.async { + self.delegate?.notificationSyncSetupConfirmed(connection: self) + } + submitUserConsent(accepted: true, trustDevice: false) + return + } + + guard let metadata = mirroredNotificationMetadata, + metadata.hasSetupPinHash else { + self.rejectTransfer(with: .reject) + return + } + + let matches = TrustStore.shared.confirmPendingNotificationSyncTrust( + secretIdHex: peerCertificate.secretID.hex, + pinHash: metadata.setupPinHash + ) + + guard matches else { + self.rejectTransfer(with: .reject) + return + } + + TrustStore.shared.addTrusted(certificate: peerCertificate, device: device) + DispatchQueue.main.async { + self.delegate?.notificationSyncSetupConfirmed(connection: self) + } + submitUserConsent(accepted: true, trustDevice: false) + return + } + + if !isAuthenticated || isNotificationSyncSetupPing { let metadata = TransferMetadata( files: [], id: id, @@ -681,6 +734,21 @@ class InboundNearbyConnection: NearbyConnection { func submitUserConsent(accepted: Bool, trustDevice: Bool) { + if isNotificationSyncSetupPing, let peerCertificate = peerCertificate { + let secretIdHex = peerCertificate.secretID.hex + if accepted { + if TrustStore.shared.findTrustedKey(for: peerCertificate.secretID) == nil, + let pinCode = pinCode { + TrustStore.shared.registerPendingNotificationSyncTrust( + secretIdHex: secretIdHex, + pinCode: pinCode + ) + } + } else { + TrustStore.shared.clearPendingNotificationSyncTrust(secretIdHex: secretIdHex) + } + } + if trustDevice, let peerCertificate = peerCertificate, let remoteDeviceInfo = remoteDeviceInfo { TrustStore.shared.addTrusted(certificate: peerCertificate, device: remoteDeviceInfo) } @@ -747,7 +815,9 @@ class InboundNearbyConnection: NearbyConnection { try sendTransferSetupFrame(frame) if let mirroredNotificationMetadata { - MirroredNotificationPresenter.shared.present(metadata: mirroredNotificationMetadata, senderDeviceName: remoteDeviceInfo?.name) + if !isNotificationSyncSetupPing { + MirroredNotificationPresenter.shared.present(metadata: mirroredNotificationMetadata, senderDeviceName: remoteDeviceInfo?.name) + } try sendDisconnectionAndDisconnect() } } catch { @@ -757,10 +827,10 @@ class InboundNearbyConnection: NearbyConnection { } - private func rejectTransfer(with reason: Sharing_Nearby_ConnectionResponseFrame.Status = .reject) { + private func rejectTransfer(with reason: Sharing_Nearby_ConnectionResponseFrame.Status = .reject, markAsUserRejected: Bool = true) { // rejected by user - if reason == .reject { + if reason == .reject && markAsUserRejected { self.wasUserRejected = true } diff --git a/NearbyShare/Connection/MirroredNotificationSupport.swift b/NearbyShare/Connection/MirroredNotificationSupport.swift index aad1393..5c741b0 100644 --- a/NearbyShare/Connection/MirroredNotificationSupport.swift +++ b/NearbyShare/Connection/MirroredNotificationSupport.swift @@ -16,7 +16,6 @@ final class MirroredNotificationPresenter { private let queue = DispatchQueue(label: "MirroredNotificationPresenter") private var pendingNotifications: [(Sharing_Nearby_MirroredNotificationMetadata, String?)] = [] private var authorizationRequestInFlight = false - private init() {} func present(metadata: Sharing_Nearby_MirroredNotificationMetadata, senderDeviceName: String?) { @@ -106,7 +105,6 @@ final class MirroredNotificationPresenter { let identifier = makeIdentifier(sender: identifierSender, notificationKey: notificationKey) let request = UNNotificationRequest(identifier: identifier, content: content, trigger: nil) - center.add(request) { error in if let error = error { log("[MirroredNotificationPresenter] Could not post notification: \(error.localizedDescription)") diff --git a/NearbyShare/Connection/NearbyConnectionManager.swift b/NearbyShare/Connection/NearbyConnectionManager.swift index 22d4454..2589801 100644 --- a/NearbyShare/Connection/NearbyConnectionManager.swift +++ b/NearbyShare/Connection/NearbyConnectionManager.swift @@ -364,7 +364,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb // Notification-sync transfers suppress normal success callbacks, but // still forward failures so pending consent/error UI can be cleaned up. - if connection.shouldSuppressAppDelegates, error == nil { + if connection.isMirroredNotificationTransfer, error == nil { return } @@ -374,6 +374,12 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb } } } + + func notificationSyncSetupConfirmed(connection _: InboundNearbyConnection) { + inboundAppDelegates.forEach { delegate in + delegate.notificationSyncSetupConfirmed() + } + } func showPlusScreen() { diff --git a/NearbyShare/Model/DataModel.swift b/NearbyShare/Model/DataModel.swift index 74d0299..40fe7b3 100644 --- a/NearbyShare/Model/DataModel.swift +++ b/NearbyShare/Model/DataModel.swift @@ -19,6 +19,7 @@ protocol InboundNearbyConnectionDelegate { func updatedTransferProgress(connection: InboundNearbyConnection, progress: Double) func connectionWasTerminated(connection: InboundNearbyConnection, savedFiles: [URL], error: Error?) func showPlusScreen() + func notificationSyncSetupConfirmed(connection: InboundNearbyConnection) } @@ -37,6 +38,11 @@ public protocol InboundAppDelegate: AnyObject { func connectionWasTerminated(connectionID: String, from device: RemoteDeviceInfo?, savedFiles: [URL], wasPlainTextTransfer: Bool, error: Error?) func transferProgress(connectionID: String, progress: Double) func showPlusScreen() + func notificationSyncSetupConfirmed() +} + +extension InboundAppDelegate { + func notificationSyncSetupConfirmed() {} } @@ -330,6 +336,7 @@ public enum NearbyError: Error { case packetFilterError case firewallError case inputOutput + case notificationSyncNotTrusted case canceled(reason: CancellationReason) public enum CancellationReason { diff --git a/NearbyShare/Model/Protobuf/wire_format.pb.swift b/NearbyShare/Model/Protobuf/wire_format.pb.swift index 353e3ec..af65b31 100644 --- a/NearbyShare/Model/Protobuf/wire_format.pb.swift +++ b/NearbyShare/Model/Protobuf/wire_format.pb.swift @@ -334,7 +334,7 @@ struct Sharing_Nearby_WifiCredentialsMetadata: Sendable { fileprivate var _id: Int64? = nil } -/// NEXT_ID=8 +/// NEXT_ID=10 struct Sharing_Nearby_MirroredNotificationMetadata: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -403,6 +403,24 @@ struct Sharing_Nearby_MirroredNotificationMetadata: Sendable { /// Clears the value of `postedAtEpochMs`. Subsequent reads from it will return its default value. mutating func clearPostedAtEpochMs() {self._postedAtEpochMs = nil} + var setupRequest: Bool { + get {return _setupRequest ?? false} + set {_setupRequest = newValue} + } + /// Returns true if `setupRequest` has been explicitly set. + var hasSetupRequest: Bool {return self._setupRequest != nil} + /// Clears the value of `setupRequest`. Subsequent reads from it will return its default value. + mutating func clearSetupRequest() {self._setupRequest = nil} + + var setupPinHash: Data { + get {return _setupPinHash ?? Data()} + set {_setupPinHash = newValue} + } + /// Returns true if `setupPinHash` has been explicitly set. + var hasSetupPinHash: Bool {return self._setupPinHash != nil} + /// Clears the value of `setupPinHash`. Subsequent reads from it will return its default value. + mutating func clearSetupPinHash() {self._setupPinHash = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -414,6 +432,8 @@ struct Sharing_Nearby_MirroredNotificationMetadata: Sendable { fileprivate var _title: String? = nil fileprivate var _body: String? = nil fileprivate var _postedAtEpochMs: Int64? = nil + fileprivate var _setupRequest: Bool? = nil + fileprivate var _setupPinHash: Data? = nil } /// NEXT_ID=8 @@ -1465,7 +1485,7 @@ extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: SwiftProtobuf._Pr extension Sharing_Nearby_MirroredNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MirroredNotificationMetadata" - static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{3}notification_key\0\u{3}package_name\0\u{3}app_name\0\u{1}title\0\u{1}body\0\u{3}posted_at_epoch_ms\0") + static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{3}notification_key\0\u{3}package_name\0\u{3}app_name\0\u{1}title\0\u{1}body\0\u{3}posted_at_epoch_ms\0\u{3}setup_request\0\u{3}setup_pin_hash\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -1480,6 +1500,8 @@ extension Sharing_Nearby_MirroredNotificationMetadata: SwiftProtobuf.Message, Sw case 5: try { try decoder.decodeSingularStringField(value: &self._title) }() case 6: try { try decoder.decodeSingularStringField(value: &self._body) }() case 7: try { try decoder.decodeSingularInt64Field(value: &self._postedAtEpochMs) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self._setupRequest) }() + case 9: try { try decoder.decodeSingularBytesField(value: &self._setupPinHash) }() default: break } } @@ -1511,6 +1533,12 @@ extension Sharing_Nearby_MirroredNotificationMetadata: SwiftProtobuf.Message, Sw try { if let v = self._postedAtEpochMs { try visitor.visitSingularInt64Field(value: v, fieldNumber: 7) } }() + try { if let v = self._setupRequest { + try visitor.visitSingularBoolField(value: v, fieldNumber: 8) + } }() + try { if let v = self._setupPinHash { + try visitor.visitSingularBytesField(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -1522,6 +1550,8 @@ extension Sharing_Nearby_MirroredNotificationMetadata: SwiftProtobuf.Message, Sw if lhs._title != rhs._title {return false} if lhs._body != rhs._body {return false} if lhs._postedAtEpochMs != rhs._postedAtEpochMs {return false} + if lhs._setupRequest != rhs._setupRequest {return false} + if lhs._setupPinHash != rhs._setupPinHash {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/NearbyShare/Model/ProtobufSource/wire_format.proto b/NearbyShare/Model/ProtobufSource/wire_format.proto index d716b75..b429614 100644 --- a/NearbyShare/Model/ProtobufSource/wire_format.proto +++ b/NearbyShare/Model/ProtobufSource/wire_format.proto @@ -127,7 +127,7 @@ message WifiCredentialsMetadata { optional int64 id = 5; } -// NEXT_ID=8 +// NEXT_ID=10 message MirroredNotificationMetadata { optional int32 version = 1 [default = 1]; optional string notification_key = 2; @@ -136,6 +136,8 @@ message MirroredNotificationMetadata { optional string title = 5; optional string body = 6; optional int64 posted_at_epoch_ms = 7; + optional bool setup_request = 8; + optional bytes setup_pin_hash = 9; } // NEXT_ID=8 diff --git a/NearbyShare/Util/TrustStore.swift b/NearbyShare/Util/TrustStore.swift index 151d96c..f031046 100644 --- a/NearbyShare/Util/TrustStore.swift +++ b/NearbyShare/Util/TrustStore.swift @@ -5,9 +5,8 @@ // Created by Leon Böttger on 22.08.25. // - import Foundation - +import CryptoKit class TrustStore: ObservableObject { @@ -16,6 +15,9 @@ class TrustStore: ObservableObject { @Published private(set) var trustedCertificates: [String: TrustedCertificate] = [:] private let trustedKeysKey = "com.leonboettger.quickdrop.identity.trustedKeys" + private let pendingNotificationSyncQueue = DispatchQueue(label: "TrustStore.notificationSyncPending") + private var pendingNotificationSyncTrust: [String: PendingNotificationSyncTrust] = [:] + private let pendingNotificationSyncTTL: TimeInterval = 5 * 60 private init() { loadTrustedCertificates() @@ -86,6 +88,48 @@ class TrustStore: ObservableObject { trustedCertificates.removeValue(forKey: secretIdHex) saveTrustedCertificates() } + + + // MARK: - Notification Sync Pending Trust + + func registerPendingNotificationSyncTrust(secretIdHex: String, pinCode: String) { + let normalized = secretIdHex.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + let trimmedPin = pinCode.trimmingCharacters(in: .whitespacesAndNewlines) + guard !normalized.isEmpty, !trimmedPin.isEmpty else { return } + + let pinHash = Self.pinHash(for: trimmedPin) + pendingNotificationSyncQueue.sync { + pendingNotificationSyncTrust[normalized] = PendingNotificationSyncTrust( + pinHash: pinHash, + createdAt: Date() + ) + } + } + + func confirmPendingNotificationSyncTrust(secretIdHex: String, pinHash: Data) -> Bool { + let normalized = secretIdHex.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + guard !normalized.isEmpty, !pinHash.isEmpty else { return false } + + let now = Date() + return pendingNotificationSyncQueue.sync { + guard let pending = pendingNotificationSyncTrust[normalized] else { return false } + pendingNotificationSyncTrust.removeValue(forKey: normalized) + let expired = now.timeIntervalSince(pending.createdAt) > pendingNotificationSyncTTL + if expired { + return false + } + return pending.pinHash == pinHash + } + } + + func clearPendingNotificationSyncTrust(secretIdHex: String) { + let normalized = secretIdHex.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + guard !normalized.isEmpty else { return } + + _ = pendingNotificationSyncQueue.sync { + pendingNotificationSyncTrust.removeValue(forKey: normalized) + } + } struct TrustedCertificate: Codable, Equatable { @@ -96,6 +140,11 @@ class TrustStore: ObservableObject { let certificateData: Data } + struct PendingNotificationSyncTrust: Equatable { + let pinHash: Data + let createdAt: Date + } + private func persistTrustedCertificates() throws { let data = try JSONEncoder().encode(trustedCertificates) @@ -116,4 +165,10 @@ class TrustStore: ObservableObject { } return decoded } + + private static func pinHash(for pinCode: String) -> Data { + let data = Data(pinCode.utf8) + let digest = SHA256.hash(data: data) + return Data(digest) + } } diff --git a/QuickDrop/Localizable.xcstrings b/QuickDrop/Localizable.xcstrings index b3a14b8..334c942 100644 --- a/QuickDrop/Localizable.xcstrings +++ b/QuickDrop/Localizable.xcstrings @@ -22356,6 +22356,1404 @@ } } }, + "NotificationSyncToastEnableSubtitle" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تفعيل مزامنة الإشعارات؟" + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Activar la sincronització de notificacions?" + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Povolit synchronizaci oznámení?" + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aktivér notifikationssynk?" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Benachrichtigungssync aktivieren?" + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ενεργοποίηση συγχρονισμού ειδοποιήσεων;" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enable Notification Sync?" + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enable Notification Sync?" + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enable Notification Sync?" + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enable Notification Sync?" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "¿Activar la sincronización de notificaciones?" + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "¿Activar la sincronización de notificaciones?" + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ota ilmoitussynk käyttöön?" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Activer la synchro des notifications ?" + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Activer la synchro des notifications ?" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "להפעיל סנכרון התראות?" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "नोटिफिकेशन सिंक चालू करें?" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Uključiti sinkronizaciju obavijesti?" + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Értesítésszinkron bekapcsolása?" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aktifkan sinkronisasi notifikasi?" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Attivare la sincronizzazione notifiche?" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "通知同期を有効にしますか?" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "알림 동기화를 켤까요?" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aktifkan penyegerakan notifikasi?" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aktiver varselsynk?" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Meldingsync inschakelen?" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Włączyć synchronizację powiadomień?" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ativar sincronização de notificações?" + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ativar sincronização de notificações?" + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Activați sincronizarea notificărilor?" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Включить синхронизацию уведомлений?" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aktivera aviseringssynk?" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "เปิดซิงค์การแจ้งเตือน?" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Bildirim senkronu açılsın mı?" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Увімкнути синхронізацію сповіщень?" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Bật đồng bộ thông báo?" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "启用通知同步?" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "啟用通知同步?" + } + } + } + }, + "NotificationSyncToastPinSubtitle" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "أدخل %@ على هاتفك." + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introdueix %@ al teu telèfon." + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Zadej %@ do telefonu." + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Indtast %@ på din telefon." + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gib %@ auf deinem Handy ein." + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Εισαγάγετε %@ στο τηλέφωνό σας." + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter %@ on your phone." + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter %@ on your phone." + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter %@ on your phone." + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter %@ on your phone." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introduce %@ en tu teléfono." + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ingresa %@ en tu teléfono." + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Syötä %@ puhelimeesi." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Entrez %@ sur votre téléphone." + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Entrez %@ sur votre téléphone." + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "הזן %@ בטלפון שלך." + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "अपने फ़ोन में %@ दर्ज करें।" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unesi %@ na telefon." + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add meg %@-et a telefonodon." + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Masukkan %@ di ponsel Anda." + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Inserisci %@ sul telefono." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "電話に%@を入力してください。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "휴대전화에 %@ 입력." + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Masukkan %@ pada telefon anda." + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Skriv inn %@ på telefonen." + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Voer %@ in op je telefoon." + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wpisz %@ na telefonie." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Digite %@ no seu telefone." + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introduz %@ no teu telemóvel." + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introduceți %@ pe telefon." + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Введите %@ на телефоне." + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Skriv in %@ på din telefon." + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "กรอก %@ บนโทรศัพท์ของคุณ" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Telefona %@ girin." + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Введіть %@ на телефоні." + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Nhập %@ trên điện thoại." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "在手机上输入%@。" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "在手機上輸入%@。" + } + } + } + }, + "NotificationSyncNotTrustedMessage" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هذا الجهاز غير موثوق لمزامنة الإشعارات. عطّل وفعّل مشاركة الإشعارات في تطبيق أندرويد." + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aquest dispositiu no és de confiança per a la sincronització de notificacions. Desactiva i torna a activar la compartició de notificacions a l'app d'Android." + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Toto zařízení není důvěryhodné pro synchronizaci oznámení. V aplikaci pro Android vypněte a znovu zapněte sdílení oznámení." + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Denne enhed er ikke betroet til notifikationssynk. Deaktivér og genaktivér notifikationsdeling i Android-appen." + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dieses Gerät ist nicht vertrauenswürdig für die Benachrichtigungssynchronisierung. Deaktiviere und aktiviere das Teilen von Benachrichtigungen in der Android‑App erneut." + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Η συσκευή δεν είναι αξιόπιστη για συγχρονισμό ειδοποιήσεων. Απενεργοποιήστε και ενεργοποιήστε ξανά την κοινοποίηση ειδοποιήσεων στην εφαρμογή Android." + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "This device isn't trusted for notification sync. Disable and re-enable notification sharing in the Android app." + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "This device isn't trusted for notification sync. Disable and re-enable notification sharing in the Android app." + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "This device isn't trusted for notification sync. Disable and re-enable notification sharing in the Android app." + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "This device isn't trusted for notification sync. Disable and re-enable notification sharing in the Android app." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Este dispositivo no es de confianza para la sincronización de notificaciones. Desactiva y vuelve a activar el compartir notificaciones en la app de Android." + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "Este dispositivo no es de confianza para la sincronización de notificaciones. Desactiva y vuelve a activar el compartir notificaciones en la app de Android." + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tämä laite ei ole luotettu ilmoitussynkille. Poista ilmoitusten jako käytöstä ja ota se uudelleen käyttöön Android‑sovelluksessa." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cet appareil n’est pas fiable pour la synchro des notifications. Désactivez puis réactivez le partage des notifications dans l’app Android." + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cet appareil n’est pas fiable pour la synchro des notifications. Désactivez puis réactivez le partage des notifications dans l’app Android." + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "המכשיר הזה אינו מהימן לסנכרון התראות. כבה והפעל שוב שיתוף התראות באפליקציית Android." + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "यह डिवाइस नोटिफिकेशन सिंक के लिए भरोसेमंद नहीं है। Android ऐप में नोटिफिकेशन शेयरिंग बंद करके फिर चालू करें।" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ovaj uređaj nije pouzdan za sinkronizaciju obavijesti. Isključite i ponovno uključite dijeljenje obavijesti u Android aplikaciji." + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ez az eszköz nem megbízható az értesítésszinkronhoz. Kapcsold ki, majd be újra az értesítésmegosztást az Android‑alkalmazásban." + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Perangkat ini tidak tepercaya untuk sinkronisasi notifikasi. Nonaktifkan lalu aktifkan kembali berbagi notifikasi di aplikasi Android." + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Questo dispositivo non è attendibile per la sincronizzazione delle notifiche. Disattiva e riattiva la condivisione notifiche nell'app Android." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "このデバイスは通知同期で信頼されていません。Androidアプリで通知共有をオフにして再度オンにしてください。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "이 기기는 알림 동기화에 신뢰되지 않습니다. Android 앱에서 알림 공유를 끄고 다시 켜세요." + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Peranti ini tidak dipercayai untuk penyegerakan notifikasi. Nyahaktifkan dan aktifkan semula perkongsian notifikasi dalam aplikasi Android." + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Denne enheten er ikke betrodd for varselsynk. Slå av og på varseldeling i Android‑appen." + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dit apparaat is niet vertrouwd voor meldingsynchronisatie. Schakel het delen van meldingen in de Android‑app uit en weer in." + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "To urządzenie nie jest zaufane do synchronizacji powiadomień. Wyłącz i włącz ponownie udostępnianie powiadomień w aplikacji Android." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Este dispositivo não é confiável para sincronização de notificações. Desative e reative o compartilhamento de notificações no app Android." + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Este dispositivo não é fidedigno para a sincronização de notificações. Desative e ative novamente a partilha de notificações na app Android." + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Acest dispozitiv nu este de încredere pentru sincronizarea notificărilor. Dezactivează și reactivează partajarea notificărilor în aplicația Android." + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Это устройство не доверено для синхронизации уведомлений. Отключите и снова включите обмен уведомлениями в Android‑приложении." + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Den här enheten är inte betrodd för aviseringssynk. Stäng av och slå på aviseringdelning i Android‑appen." + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "อุปกรณ์นี้ไม่ได้รับความไว้วางใจสำหรับการซิงค์การแจ้งเตือน ปิดแล้วเปิดการแชร์การแจ้งเตือนในแอป Android อีกครั้ง" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Bu cihaz bildirim senkronu için güvenilir değil. Android uygulamasında bildirim paylaşımını kapatıp tekrar açın." + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Цей пристрій не є довіреним для синхронізації сповіщень. Вимкніть і знову ввімкніть спільний доступ до сповіщень в Android‑додатку." + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Thiết bị này không đáng tin cậy cho đồng bộ thông báo. Tắt rồi bật lại chia sẻ thông báo trong ứng dụng Android." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "此设备未被信任用于通知同步。请在 Android 应用中关闭并重新开启通知共享。" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "此裝置未被信任用於通知同步。請在 Android 應用中關閉並重新開啟通知分享。" + } + } + } + }, + "NotificationSyncConsentDetail" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إذا وافقت، سيظهر رمز PIN لإدخاله على هاتفك." + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Si acceptes, veuràs un PIN per introduir-lo al teu telèfon." + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Pokud souhlasíte, zobrazí se PIN, který zadáte do telefonu." + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Hvis du accepterer, får du vist en PIN-kode, som du skal indtaste på din telefon." + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wenn du akzeptierst, siehst du einen PIN, den du auf deinem Handy eingeben musst." + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Αν αποδεχτείτε, θα εμφανιστεί ένας PIN για να τον εισαγάγετε στο τηλέφωνό σας." + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you accept, you’ll see a PIN to enter on your phone." + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you accept, you’ll see a PIN to enter on your phone." + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you accept, you’ll see a PIN to enter on your phone." + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "If you accept, you’ll see a PIN to enter on your phone." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Si aceptas, verás un PIN para introducirlo en tu teléfono." + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "Si aceptas, verás un PIN para ingresarlo en tu teléfono." + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Jos hyväksyt, näet PIN-koodin, joka pitää syöttää puhelimeen." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Si vous acceptez, un code PIN s’affichera pour être saisi sur votre téléphone." + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Si vous acceptez, un code PIN s’affichera à saisir sur votre téléphone." + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "אם תאשרו, יוצג קוד PIN להזנה בטלפון שלכם." + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "यदि आप स्वीकार करते हैं, तो आपके फ़ोन पर दर्ज करने के लिए एक PIN दिखाई देगा।" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ako prihvatite, prikazat će se PIN koji trebate unijeti na svoj telefon." + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ha elfogadod, megjelenik egy PIN-kód, amelyet a telefonodon kell megadnod." + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Jika Anda menyetujui, PIN akan ditampilkan untuk dimasukkan di ponsel Anda." + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Se accetti, verrà mostrato un PIN da inserire sul telefono." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "承諾すると、電話に入力するPINが表示されます。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "승인하면 휴대전화에 입력할 PIN이 표시됩니다." + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Jika anda terima, PIN akan dipaparkan untuk dimasukkan pada telefon anda." + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Hvis du godtar, vises en PIN du må skrive inn på telefonen." + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Als je accepteert, zie je een pincode die je op je telefoon moet invoeren." + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Jeśli zaakceptujesz, pojawi się PIN do wpisania na telefonie." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Se você aceitar, será exibido um PIN para você digitar no seu telefone." + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Se aceitares, será apresentado um PIN para introduzires no teu telemóvel." + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dacă accepți, va apărea un PIN pe care să îl introduci pe telefon." + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Если вы согласитесь, появится PIN-код, который нужно ввести на телефоне." + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Om du godkänner visas en PIN-kod som du anger på din telefon." + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "หากคุณยอมรับ ระบบจะแสดง PIN เพื่อให้คุณกรอกบนโทรศัพท์ของคุณ" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kabul ederseniz telefonunuza girmeniz için bir PIN gösterilecektir." + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Якщо ви погодитеся, з’явиться PIN-код, який потрібно ввести на телефоні." + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Nếu bạn chấp nhận, một mã PIN sẽ hiển thị để bạn nhập trên điện thoại." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "如果你同意,将显示一个 PIN 供你在手机上输入。" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "如果你同意,將顯示一個 PIN 供你在手機上輸入。" + } + } + } + }, + "NotificationSyncPinEntryTitle" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "مطلوب رمز QuickDrop" + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cal el codi de QuickDrop" + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Je vyžadován kód QuickDrop" + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-kode påkrævet" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop‑Code erforderlich" + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Απαιτείται κωδικός QuickDrop" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop code required" + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop code required" + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop code required" + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop code required" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Se requiere el código de QuickDrop" + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "Se requiere el código de QuickDrop" + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-koodi vaaditaan" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Code QuickDrop requis" + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Code QuickDrop requis" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "נדרש קוד QuickDrop" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop कोड आवश्यक" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Potreban je QuickDrop kod" + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-kód szükséges" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kode QuickDrop diperlukan" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Codice QuickDrop richiesto" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDropコードが必要です" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop 코드가 필요함" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kod QuickDrop diperlukan" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-kode kreves" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-code vereist" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wymagany kod QuickDrop" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Código do QuickDrop necessário" + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Código QuickDrop necessário" + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Este necesar codul QuickDrop" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Требуется код QuickDrop" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop-kod krävs" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "ต้องใช้รหัส QuickDrop" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "QuickDrop kodu gerekli" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Потрібен код QuickDrop" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cần mã QuickDrop" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "需要 QuickDrop 代码" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "需要 QuickDrop 代碼" + } + } + } + }, + "NotificationSyncPinEntryMessage" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "أدخل هذا الرمز على هاتفك لتفعيل مزامنة الإشعارات." + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introdueix aquest codi al teu telèfon per activar la sincronització de notificacions." + } + }, + "cs" : { + "stringUnit" : { + "state" : "translated", + "value" : "Zadejte tento kód do telefonu a aktivujte synchronizaci oznámení." + } + }, + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Indtast denne kode på din telefon for at aktivere synkronisering af notifikationer." + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gib diesen Code jetzt auf deinem Handy ein, um die Benachrichtigungssynchronisierung zu aktivieren." + } + }, + "el" : { + "stringUnit" : { + "state" : "translated", + "value" : "Εισαγάγετε αυτόν τον κωδικό στο τηλέφωνό σας για να ενεργοποιήσετε τον συγχρονισμό ειδοποιήσεων." + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter this code on your phone to enable notification sync." + } + }, + "en-AU" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter this code on your phone to enable notification sync." + } + }, + "en-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter this code on your phone to enable notification sync." + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enter this code on your phone to enable notification sync." + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introduce este código en tu teléfono para activar la sincronización de notificaciones." + } + }, + "es-419" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ingresa este código en tu teléfono para activar la sincronización de notificaciones." + } + }, + "fi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Syötä tämä koodi puhelimeesi ottaaksesi ilmoitusten synkronoinnin käyttöön." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Saisissez ce code sur votre téléphone pour activer la synchronisation des notifications." + } + }, + "fr-CA" : { + "stringUnit" : { + "state" : "translated", + "value" : "Entrez ce code sur votre téléphone pour activer la synchronisation des notifications." + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "הזינו את הקוד הזה בטלפון שלכם כדי להפעיל סנכרון התראות." + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "नोटिफिकेशन सिंक चालू करने के लिए यह कोड अपने फ़ोन पर दर्ज करें।" + } + }, + "hr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Unesite ovaj kod na svoj telefon kako biste omogućili sinkronizaciju obavijesti." + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add meg ezt a kódot a telefonodon az értesítések szinkronizálásának engedélyezéséhez." + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Masukkan kode ini di ponsel Anda untuk mengaktifkan sinkronisasi notifikasi." + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Inserisci questo codice sul telefono per attivare la sincronizzazione delle notifiche." + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "このコードを電話に入力して通知同期を有効にしてください。" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "이 코드를 휴대전화에 입력하여 알림 동기화를 활성화하세요." + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Masukkan kod ini pada telefon anda untuk mengaktifkan penyegerakan pemberitahuan." + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Skriv inn denne koden på telefonen for å aktivere varselsynkronisering." + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Voer deze code in op je telefoon om meldingssynchronisatie in te schakelen." + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wpisz ten kod na telefonie, aby włączyć synchronizację powiadomień." + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Digite este código no seu telefone para ativar a sincronização de notificações." + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introduz este código no teu telemóvel para ativar a sincronização de notificações." + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Introdu acest cod pe telefon pentru a activa sincronizarea notificărilor." + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Введите этот код на телефоне, чтобы включить синхронизацию уведомлений." + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ange den här koden på din telefon för att aktivera aviseringars synkronisering." + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "กรอกรหัสนี้บนโทรศัพท์ของคุณเพื่อเปิดใช้งานการซิงค์การแจ้งเตือน" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Bildirim senkronizasyonunu etkinleştirmek için bu kodu telefonunuza girin." + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Введіть цей код на телефоні, щоб увімкнути синхронізацію сповіщень." + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Nhập mã này trên điện thoại để bật đồng bộ thông báo." + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "在手机上输入此代码以启用通知同步。" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "在手機上輸入此代碼以啟用通知同步。" + } + } + } + }, "NotificationSyncFallbackSenderAndroid" : { "extractionState" : "manual", "localizations" : { @@ -44465,4 +45863,4 @@ } }, "version" : "1.0" -} \ No newline at end of file +} diff --git a/QuickDrop/Util/ErrorAlertHandler.swift b/QuickDrop/Util/ErrorAlertHandler.swift index e29fa93..c99befb 100644 --- a/QuickDrop/Util/ErrorAlertHandler.swift +++ b/QuickDrop/Util/ErrorAlertHandler.swift @@ -36,7 +36,6 @@ class ErrorAlertHandler { var description = "" let fixInstructions = " " + "Error.FixInstructions".localized() - if let ne = (error as? NearbyError) { switch ne { case .inputOutput: @@ -61,6 +60,8 @@ class ErrorAlertHandler { description = errorMessage + fixInstructions case .ukey2: description = "Error.Crypto".localized() + ": \(ne.localizedDescription)" + fixInstructions + case .notificationSyncNotTrusted: + description = "NotificationSyncNotTrustedMessage".localized() case .canceled(reason: let reason): if reason == .timedOut { description = reason.localizedDescription() + fixInstructions diff --git a/QuickDrop/View/Toast/QuickDropToastView.swift b/QuickDrop/View/Toast/QuickDropToastView.swift index e1b329a..e9c3370 100644 --- a/QuickDrop/View/Toast/QuickDropToastView.swift +++ b/QuickDrop/View/Toast/QuickDropToastView.swift @@ -55,12 +55,16 @@ struct QuickDropToastView: View { let consent = receiveModel.consentState let actions = receiveModel.toastActions let hasActionButtons = actions?.openFilesAction != nil || actions?.importPhotosAction != nil - let showsRightColumn = consent != nil || hasActionButtons + let deviceName = receiveModel.activeDeviceName ?? "AndroidDevice".localized() + let isNotificationSyncToast = consent?.notificationSyncStage != nil + let isNotificationSyncConsent = consent?.notificationSyncStage == .consent + let isNotificationSyncPinStage = consent?.notificationSyncStage == .pin + let showConsentActions = consent != nil && (!isNotificationSyncToast || isNotificationSyncConsent) + let showsRightColumn = showConsentActions || hasActionButtons let subHeaderSize = 21.0 - let closeButtonVisible = isHovering && actions != nil - let deviceName = receiveModel.activeDeviceName ?? "AndroidDevice".localized() + let closeButtonVisible = isHovering && (actions != nil || isNotificationSyncPinStage) ZStack(alignment: .topTrailing) { HStack(alignment: .center, spacing: 12) { @@ -74,15 +78,26 @@ struct QuickDropToastView: View { VStack(alignment: .leading, spacing: 2) { if let consent = consent { - Text(verbatim: "QuickDrop | \(consent.pinCodeMessage)") - .font(.system(size: 14, weight: .semibold)) + if isNotificationSyncToast { + Text(verbatim: "QuickDrop - \(deviceName)") + .font(.system(size: 14, weight: .semibold)) - Text(consent.message) - .font(.system(size: 13)) - .foregroundColor(.secondary) - .lineLimit(1) - .truncationMode(.tail) - .frame(height: subHeaderSize) + Text(consent.message) + .font(.system(size: 13)) + .foregroundColor(.secondary) + .lineLimit(2) + .truncationMode(.tail) + } else { + Text(verbatim: "QuickDrop | \(consent.pinCodeMessage)") + .font(.system(size: 14, weight: .semibold)) + + Text(consent.message) + .font(.system(size: 13)) + .foregroundColor(.secondary) + .lineLimit(1) + .truncationMode(.tail) + .frame(height: subHeaderSize) + } } else { HStack { Text(String("QuickDrop")) @@ -140,8 +155,9 @@ struct QuickDropToastView: View { .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) if showsRightColumn { - ActionColumn(width: consent == nil ? actionColumnWidthEnd : actionColumnWidth) { - if let consent = consent { + let columnWidth = showConsentActions ? actionColumnWidth : actionColumnWidthEnd + ActionColumn(width: columnWidth) { + if showConsentActions, let consent = consent { ActionButtonRow { QuickDropToastViewButton(title: "Decline") { consent.declineAction() @@ -225,8 +241,14 @@ struct QuickDropToastView: View { .stroke((colorScheme.isLight ? Color.white.opacity(0.5) : Color.gray.opacity(0.33)), lineWidth: 1) ) .overlay(alignment: .topTrailing) { - if closeButtonVisible, let actions = actions { - Button(action: actions.closeToastAction) { + if closeButtonVisible { + Button(action: { + if let actions = actions { + actions.closeToastAction() + } else if isNotificationSyncPinStage { + receiveModel.hideQuickDropToast(style: .fade) + } + }) { Image(systemName: "xmark") .font(.system(size: 9, weight: .semibold)) .foregroundColor(.secondary) @@ -486,6 +508,7 @@ struct QuickDropToastView_Previews: PreviewProvider { transferID: "preview", pinCodeMessage: "PIN: 1233", message: "45 images from Pixel 6 Pro", + notificationSyncStage: nil, allowsTrust: true, acceptAction: { _ in }, declineAction: { } @@ -512,6 +535,7 @@ struct QuickDropToastView_Previews: PreviewProvider { transferID: "preview", pinCodeMessage: "PIN: 1233", message: "45 images from Pixel 6 Pro", + notificationSyncStage: nil, allowsTrust: false, acceptAction: { _ in }, declineAction: { } diff --git a/QuickDrop/ViewModel/ReceiveModel.swift b/QuickDrop/ViewModel/ReceiveModel.swift index 024493a..57188a5 100644 --- a/QuickDrop/ViewModel/ReceiveModel.swift +++ b/QuickDrop/ViewModel/ReceiveModel.swift @@ -8,6 +8,9 @@ import SwiftUI import StoreKit import LUI +#if os(macOS) +import AppKit +#endif class ReceiveModel: ObservableObject, InboundAppDelegate { @@ -90,19 +93,35 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { let resolvedSenderName = (senderName?.isEmpty == false) ? senderName! : "AndroidDevice".localized() self.activeDeviceName = resolvedSenderName - let alert = NSAlert() - alert.alertStyle = .informational - alert.messageText = "NotificationSyncConsentPromptFromDevice".localized(with: resolvedSenderName) - alert.informativeText = pinCodeMessage - alert.addButton(withTitle: "Accept".localized()) - alert.addButton(withTitle: "Decline".localized()) - - let result = alert.runModal() - if result == .alertFirstButtonReturn { - primaryButtonAction(true) - } else { - secondaryButtonAction() - } + let pinCode = transfer.pinCode ?? "----" + self.consentState = ConsentToastState( + transferID: transferID, + pinCodeMessage: resolvedSenderName, + message: "NotificationSyncToastEnableSubtitle".localized(), + notificationSyncStage: .consent, + allowsTrust: false, + acceptAction: { [weak self] _ in + guard let self else { return } + primaryButtonAction(false) + self.consentState = ConsentToastState( + transferID: transferID, + pinCodeMessage: resolvedSenderName, + message: "NotificationSyncToastPinSubtitle".localized(with: pinCode), + notificationSyncStage: .pin, + allowsTrust: false, + acceptAction: { _ in }, + declineAction: {} + ) + self.showQuickDropToast(for: transferID) + }, + declineAction: { [weak self] in + guard let self else { return } + self.consentState = nil + secondaryButtonAction() + self.hideQuickDropToast(style: .fade) + } + ) + self.showQuickDropToast(for: transferID) return } @@ -113,6 +132,7 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { transferID: transferID, pinCodeMessage: pinCodeMessage, message: mainMessage, + notificationSyncStage: nil, allowsTrust: transfer.allowsToBeAddedAsTrustedDevice, acceptAction: { [weak self] trustDevice in DispatchQueue.main.async { @@ -199,6 +219,17 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { } #endif } + + + func notificationSyncSetupConfirmed() { + #if os(macOS) + DispatchQueue.main.async { + if self.consentState?.notificationSyncStage != nil { + self.hideQuickDropToast(style: .fade) + } + } + #endif + } func connectionWasTerminated(connectionID: String, from device: RemoteDeviceInfo?, savedFiles: [URL], wasPlainTextTransfer: Bool, error: (any Error)?) { @@ -657,9 +688,15 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { struct ConsentToastState { + enum NotificationSyncStage { + case consent + case pin + } + let transferID: String let pinCodeMessage: String let message: String + let notificationSyncStage: NotificationSyncStage? let allowsTrust: Bool let acceptAction: (Bool) -> () let declineAction: () -> ()