Has anyone figured out how to use the new OpenURLIntent intent to open their own app using a custom URL scheme?
I have the following code:
@available(iOS 18, *)
struct BarcodeScannerControlWidget: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: "scannerIntent") {
ControlWidgetButton(action: OpenBarcodeScannerIntent()) {
Label("Scan Barcode", systemImage: "barcode.viewfinder")
}
}
.displayName("Scan Barcode")
}
}
@available(iOS 18, *)
struct OpenBarcodeScannerIntent: AppIntent {
static var title: LocalizedStringResource = "Scan Barcode"
func perform() async throws -> some IntentResult & OpensIntent {
let url = "myscheme:///barcodeScanner
let openURLIntent = OpenURLIntent(url)
return .result(opensIntent: openURLIntent)
}
}
Running this intent doesn't seem to do anything. If I replace the URL with say "https://www.apple.com", the intent opens up safari with that URL.
Post
Replies
Boosts
Views
Activity
I'm unable to reset simulators using the menu or the xcrun simctl tool:
<output of xcrun simctl list>
== Devices ==
-- iOS 17.5 --
iPhone SE (3rd generation) (5A06623A-173D-4C96-8DD3-3E9FE39A06F1) (Shutdown)
iPhone 15 (iOS 17.5) (F4329E8D-29BB-4EA7-8465-C11A98D04ED7) (Shutdown)
-- iOS 18.0 --
iPhone SE (3rd generation) (2DDE8F03-F8E1-4C1B-8E28-CD9B208F3FFA) (Shutdown)
iPhone 16 Pro (DE788688-8AC6-40A0-B25C-A56AA423798E) (Shutdown)
iPhone 16 Pro Max (1405184C-36A9-40F3-B0D0-4EEB88452883) (Shutdown)
iPhone 16 (0CBBA7DB-B20E-4F17-BBC5-910F1F6E1A0A) (Shutdown)
iPhone 16 Plus (95421C27-11A0-4FCF-A889-DAAE8557B271) (Shutdown)
== Device Pairs ==
~/Library``
❯ xcrun simctl erase 0CBBA7DB-B20E-4F17-BBC5-910F1F6E1A0A
An error was encountered processing the command (domain=NSCocoaErrorDomain, code=513):
“data” couldn’t be moved because you don’t have permission to access “Deleting-8FEDFF47-5B2F-4534-BCA2-036BBE68CE37”.
You don’t have permission.
To view or change permissions, select the item in the Finder and choose File > Get Info.
Underlying error (domain=NSPOSIXErrorDomain, code=1):
The operation couldn’t be completed. Operation not permitted
Operation not permitted
Xcode Version 16.0 (16A242d)
MacOS 15.0.1 (24A348)