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

+2
View File
@@ -1065,6 +1065,7 @@
ENABLE_PREVIEWS = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Local network access is required to scan and connect to devices.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -1101,6 +1102,7 @@
ENABLE_PREVIEWS = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Local network access is required to scan and connect to devices.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
+6 -1
View File
@@ -12,6 +12,7 @@ class DistributionDetector {
static var isDirectDistributionEnabled: Bool {
get {
#if os(macOS)
if let cached = _directDistributionCached {
return cached
}
@@ -21,13 +22,16 @@ class DistributionDetector {
log("[DistributionDetector] isDirectDistribution: \(result)")
return result
#else
return false
#endif
}
}
static var _directDistributionCached: Bool? = nil
#if os(macOS)
private static func isDirectDistribution() -> Bool {
// 1. Get dynamic code object for our process
var code: SecCode?
@@ -69,4 +73,5 @@ class DistributionDetector {
return false
}
#endif
}
+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()