mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-12 19:41:11 +00:00
WIP: Add sending to iOS app
This commit is contained in:
1 parent
fc8d5ba268
commit
e62aca46db
4 files changed
+15
-3
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user