mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-13 03:51:11 +00:00
fix: relaunching of iOS app would stop advertising
This commit is contained in:
1 parent
9d71ed35b7
commit
7d6d0f3482
6 files changed
+66
-14
No files matched your search
@@ -14,6 +14,8 @@ let configuration = LUIConfiguration(
|
||||
|
||||
copyrightInformation: licenseText,
|
||||
|
||||
loggingUrl: getAppGroupDirectory(),
|
||||
|
||||
introductionViewInformation: "QuickDropWelcomeDescription",
|
||||
|
||||
usesAutomaticReviewPrompt: false,
|
||||
|
||||
@@ -10,6 +10,8 @@ import LUI
|
||||
|
||||
struct ContentView: View {
|
||||
|
||||
@Environment(\.scenePhase) var scenePhase
|
||||
|
||||
var body: some View {
|
||||
AppRootView(isPlus: .constant(true), phoneView: {
|
||||
DeviceListView()
|
||||
@@ -23,6 +25,21 @@ struct ContentView: View {
|
||||
}
|
||||
}
|
||||
})
|
||||
.onChange(of: scenePhase) { newValue in
|
||||
if newValue == .active {
|
||||
#if !EXTENSION
|
||||
NearbyConnectionManager.shared.becomeVisible()
|
||||
#endif
|
||||
NearbyConnectionManager.shared.startDeviceDiscovery()
|
||||
}
|
||||
|
||||
if newValue == .background {
|
||||
#if !EXTENSION
|
||||
NearbyConnectionManager.shared.becomeInvisible()
|
||||
#endif
|
||||
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user