Post

Replies

Boosts

Views

Activity

Reply to Issue with Assistant Schema Intent in Shortcut App
It appears this functionality is currently bugged or not implemented fully as of Xcode 16.0 Beta 4, but I have gotten to test my intent using the following method: In Shortcuts, create a new shortcut and then in the 'Search Actions' field, type "Search" Your app might show up there. Tap the result for your app icon, and you should be able to configure the intent and try out in app search for your app.
Jul ’24
Reply to ControlConfigurationIntent won't open the app despite setting openAppWhenRun = true
You call it like this somewhere in your perform method. @MainActor func perform() async throws -> some IntentResult & OpensIntent { guard let url = URL(string: "myapp://myappintent") else { // throw an error of your choice here } return .result(opensIntent: OpenURLIntent(deepLink)) } More here: https://stackoverflow.com/questions/78716058/ios-18-control-widget-that-opens-a-url
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to How to handle errors in App Intents for Controls in iOS 18
Can we get some clarification from an Apple engineer on what AppIntent result types are supported by Controls? It seems silly that we have access to so much from the AppIntents/AppShortcuts ecosystem which all compiles fine but fails silently when used with Controls. Dialogs and snippet views feel like things that should be supported. If they can't be used directly, we should at least be given the option to launch an existing AppShortcut that utilizes them. It seems like without putting the control intent and widget within both the extension and app target, and having the intent open the app, the point of the intent is pretty much useless. It's not clear to me, nor is it presently debuggable, what type of functionality can be run in a ControlConfigurationIntent at all. To answer your question it seems currently the only options are opening the app and showing an error message there, or briefly starting a live activity which might display an error message, and then invalidates itself after a set time interval. This seems like a ill-advised workaround though.
Topic: Machine Learning & AI SubTopic: General Tags:
Jul ’24
Reply to ControlConfigurationIntent won't open the app despite setting openAppWhenRun = true
To see if you can get it working, try putting everything in the same file (ControlConfigurationIntent and your ControlWidget) and then make sure that file is added to your main app target as well as your extension or widget bundle. This most basic code below should work with any ControlWidgetButton and when tapped will open the app. struct SampleIntent: ControlConfigurationIntent { static var title: LocalizedStringResource = "Title" static var description = IntentDescription("Description.") /// Launch your app when the system triggers this intent. static let openAppWhenRun: Bool = true @MainActor func perform() async throws -> some IntentResult { // You can add more functionality here like a deep link into your app either using a result type that opens a url or write an extension that routes to a screen. return .result() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to ControlConfigurationIntent won't open the app despite setting openAppWhenRun = true
I have discovered a workaround here: https://developer.apple.com/forums/thread/758637 It would be nice if we could get an explanation or some diagnostics as to why we need to add our control widgets to the app itself, when they are supposed to reside in an extension or Widget Bundle, since in fact, the Xcode project / target creation tool will put the default Control in an extension target only causing the above code to not work.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to Widget kit deep link
@Frameworks Engineer Please file a radar to ensure that the below is reflected in the docs. It took me a bit too long to find this thread. Thanks! Note that Link will only work in systemMedium and systemLarge, for deep linking from a systemSmall widget, you'll need to use widgetURL: https://developer.apple.com/documentation/swiftui/view/widgeturl(_:)
Sep ’20