WIP: Add sending to iOS app

This commit is contained in:
Leon Böttger committed 2025-08-14 14:48:47 +02:00
1 parent fc8d5ba268
commit e62aca46db
4 files changed
+15 -3

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ struct DeviceListView: View {
Image(systemName: "smartphone")
.resizable()
.frame(width: 30, height: 30)
Text(device.name.isEmpty ? "Android" : device.name)
Text(device.name ?? "Android")
Spacer()
if model.selectedDevice == device {
+6 -1
View File
@@ -17,7 +17,7 @@ class ShareViewModel: ObservableObject, ShareExtensionDelegate {
@Published var progressValue: Double? = nil
private var urls: [URL] = []
private var textToSend: String? = nil
private var textToSend = "Test from QuickDrop iOS"
//private var errorAlertHandler = ErrorAlertHandler.shared
private var connectionEstablished = false
@@ -25,6 +25,7 @@ class ShareViewModel: ObservableObject, ShareExtensionDelegate {
init() {
NearbyConnectionManager.shared.startDeviceDiscovery()
NearbyConnectionManager.shared.addShareExtensionDelegate(self)
}
func addDevice(device: RemoteDeviceInfo) {
@@ -64,6 +65,10 @@ class ShareViewModel: ObservableObject, ShareExtensionDelegate {
progressState = "TransferFinished".localized()
}
func startTransferWithQrCode(device: RemoteDeviceInfo) {
selectDevice(device: device)
}
func selectDevice(device: RemoteDeviceInfo) {
NearbyConnectionManager.shared.stopDeviceDiscovery()