use LSApplicationWorkspace to open PB

This commit is contained in:
leminlimez committed 2025-06-03 19:57:53 -04:00
1 parent 582efbacbf
commit b15c6854f2
4 files changed
+20 -5

No files matched your search

+5 -1
View File
@@ -76,7 +76,11 @@ struct ContentView: View {
Haptic.shared.notify(.success)
UIApplication.shared.dismissAlert(animated: false)
UIApplication.shared.confirmAlert(title: "Success!", body: "The PosterBoard app will now open. Please close it from the app switcher.", onOK: {
PosterBoardManager.runShortcut(named: "PosterBoard")
if !PosterBoardManager.openPosterBoard() {
UIApplication.shared.confirmAlert(title: "Falling Back to Shortcut", body: "PosterBoard failed to open directly. The fallback shortcut will now be opened.", onOK: {
PosterBoardManager.runShortcut(named: "PosterBoard")
}, noCancel: true)
}
}, noCancel: true)
} catch {
Haptic.shared.notify(.error)
@@ -34,8 +34,8 @@ let onBoardingCards: [OnBoardingPage] = [
image: "Logo"
),
.init(
title: "Install the Shortcut",
description: "To apply, you will need a shortcut that opens PosterBoard.",
title: "Install the Fallback Shortcut (Optional)",
description: "To apply, PosterBoard will need to open.\n\nYou can install an optional shortcut if the original method fails.",
image: "Shortcuts",
link: URL(string: PosterBoardManager.ShortcutURL),
linkName: "Get Shortcut"
+2 -2
View File
@@ -83,12 +83,12 @@ struct SettingsView: View {
Section {
if let scURL = URL(string: PosterBoardManager.ShortcutURL) {
Link(destination: scURL) {
Label("Download Shortcut", systemImage: "arrow.down.circle")
Label("Download Fallback Shortcut", systemImage: "arrow.down.circle")
}
}
if let fbURL = URL(string: "shortcuts://run-shortcut?name=PosterBoard&input=text&text=troubleshoot") {
Link(destination: fbURL) {
Label("Create Fallback Method", systemImage: "appclip")
Label("Create Additional Fallback Method", systemImage: "appclip")
}
}
if let wpURL = URL(string: PosterBoardManager.WallpapersURL) {