-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support to iOS 13.0 and Above #8
base: main
Are you sure you want to change the base?
Conversation
@a2 Although this issue is not related to this Issue since the issue of this repository has been disabled, ❶ Cannot write to data let shortcut = HelloWorldShortcut()
let data = try shortcut.build()
try data.write(to: URL(fileURLWithPath: "Hello World.shortcut")) However, I get the error message You can’t save the file “HelloWorld4.shortcut” because the volume “Data” is read only. So, I changed it to the following code: let shortcut = HelloWorldShortcut()
do {
let data = try shortcut.build()
let documentsDirectory = NSSearchPathForDirectoriesInDomains(
.documentDirectory,
.userDomainMask,
true
)[0]
let filePath = documentsDirectory.appending("/HelloWorld5.shortcut")
let fileUrl = URL(fileURLWithPath: filePath)
try data.write(to: fileUrl)
print("Shortcut added to library")
} catch (let error) {
print(error.localizedDescription)
} With this change, I was able to write to the data. Did you intend to make this change? ❷ Custom shortcut not added to Shortcuts app Thank you very much. |
❶ Cannot write to data:I assume you're running this on a ipad. ❷ Custom shortcut not added to Shortcuts app:It's possible to add the let shortcut = HelloWorldShortcut()
try shortcut.buildAndSave(atPath: URL(fileURLWithPath: "HelloWorld.shortcut")) After sign the file, you can drag the file into Shortcuts app. |
@a2 Any chance this PR can be merged soon ? |
No description provided.