mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 19:11:10 +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
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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