Post not yet marked as solved
Is it possible to use integer parameter in parameterized phrase?
I have an app shortcut where user needs to provide an integer for the app to process it. But the phrase is not recognised by Siri. The one without integer parameter works fine.
struct LogWaterShortcuts: AppShortcutsProvider {
@AppShortcutsBuilder static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: LogWaterIntent(),
phrases: [
"Log Water in \(.applicationName)",
"Log \(\.$quantity) Water in \(.applicationName)"
],
shortTitle: "Log Water",
systemImageName: "plus"
)
}
}
Is it not possible or I am doing something wrong? If it is not possible then is there any alternative that I can use to achieve the same?
Post not yet marked as solved
We have an Intent configurable widgets in our app that allows user to choose theme for widget.
After adopting App Intent for widget configuration, existing widget does not preserve the selected theme and it resets the value.
Post not yet marked as solved
Hei,
I have an issue that all our apartment homes run on custom insecure cert (which we cannot change). And customers want to make Siri commands to automate the AC with Shortcuts app.
Seems like if customer tries to run the shortcut which makes a POST with headers and body to insecure URL then they get an error message "there was a problem running the shortcut". Seems like Apple Shortcuts app does not allow to make post request to insecure URLs? Is there a way to get around it?
Regards,
Robert
Post not yet marked as solved
I have an app intent like the one below. If the intent is run via siri when the phone is locked then the user is asked to unlock their phone but the shortcut is interrupted. Is it possible to delay opening the app until the result dialog is returned?
import AppIntents
struct MyIntent: AppIntent {
static var title: LocalizedStringResource = "MyApp"
static var description = IntentDescription("Captures data")
static var openAppWhenRun: Bool = true
@Parameter(title: "The Data")
var theData: String
@MainActor
func perform() async throws -> some IntentResult {
_ = try await RESTClient.postData(theData: theData)
return .result(dialog:"Thank you!")
//TODO: Now try to open app
}
}
Post not yet marked as solved
Hi,
I am trying to integrate the new AppIntentsPackage protocol into my application. Especially what I want to do is to create a dedicate SPM package which holds all my app intents and then share that with my widget extension for Widget intents as well as the main iOS app for powering an AppShortcutProvider. Unfortunately I run into an issue here.
I have the following explanatory setup:
SPM package called ProjectAppIntents
iOS target
My AppIntents SPM package
//Package: ProjectAppIntents
public struct TestAppIntent: AppIntent {
public static var title: LocalizedStringResource = "TestAppIntent"
@Parameter(title: "Parameter1", optionsProvider: ParameterOptionProvider())
public var parameter: String
public init(parameter: String) {
self.parameter = parameter
}
public init() { }
public func perform() async throws -> some IntentResult & ReturnsValue {
.result(value: 5)
}
}
struct ParameterOptionProvider: DynamicOptionsProvider {
func results() async throws -> [String] {
return ["Hello", "World"]
}
}
public struct ProjectAppIntentsPackage: AppIntentsPackage { }
My iOS app
// Target: iOS
import ProjectAppIntents
struct ProjectApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
extension ProjectApp: AppIntentsPackage {
static var includedPackages: [AppIntentsPackage.Type] = [
ProjectAppIntentsPackage.self
]
}
struct ProjectShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: TestAppIntent(),
phrases: ["Start a \(.applicationName)"],
shortTitle: "Hello World",
systemImageName: "house"
)
}
}
When I now try to compile my app, I get the following build error:
2023-06-25 09:53:47.853 appintentsnltrainingprocessor[44848:2059163] Parsing options for appintentsnltrainingprocessor
2023-06-25 09:53:47.854 appintentsnltrainingprocessor[44848:2059163] Starting AppIntents SSU YAML Generation
2023-06-25 09:53:47.868 appintentsnltrainingprocessor[44848:2059163] error: The action TestAppIntent referenced in App Shortcut does not exist
Command AppIntentsSSUTraining failed with a nonzero exit code
So for me it seems like the compiler cannot find the AppIntent defined in an SPM package.
Am I doing something wrong here or does the AppIntentsPackage protocol not work with SPM packages ?
Thanks a lot for helping !
I'm working on creating App Shortcuts for my app to show up in the Shortcuts app and Spotlight. One new feature this year is the option to add your apps tint color as a background, but I'm not able to get this to work.
I have added the items NSAppIconActionTintColorName (String) and NSAppIconComplementingColorNames (Array?) to my info.plist file that where briefly mentioned in the WWDC23 video, but they don't seem to have any effect.
Has anyone got these to work in their project?
Post not yet marked as solved
I heavily use the macOS build in Screenshot tool. 99 % I copy partial screen to the clipboard.
However, sometimes I want the clipboard to be saved as a file into a Finder window. Just like I had copied a real image file.
I tried several options with Shortcuts, but it seems more complicated. This comes close, but has an error I don't understand:
Post not yet marked as solved
I want to run a third party shortcut after an an app intent without opening the shortcuts app. I tried using the deep linking URL method but it opens the shortcut app to run the shortcu.
Post not yet marked as solved
I set wallpaper on iPadOS 17 with apple Shortcuts app. After that I have a chosen picture for portrait orientation and black screen for landscape one.
I just wonder if there is a way to set different pictures for landscape and portrait orientation
Post not yet marked as solved
Hello,
I'm planning on building an app that provides instructions on how to implement Automation for a shortcut that will look for specific message content in messages, and forward it to my app.
I want to understand if this method isn't a breach of Apple's terms of use, considering that I intend to have this used in scale (e.g. ~50k app users).
Some things to clarify:
The content that will be searched in the Messages app will be reviewed and approved by the iPhone user.
The iPhone user will be required to manually approve every automation action that occurs
The iPhone user will have control to remove any forwarded messages that were approved by mistake or in any case of regret.
The iPhone user will be well aware of the actions he makes, and approves in terms of the process and usage of the content by app.
Thank you!
Post not yet marked as solved
I have implemented a code that answers my question with Siri, but I want to have a continuous conversation like in ChatGPT app. Can't understand documentation properly to do that.
import AppIntents
@available(iOS 16.0, *)
struct MyAppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: AskQuestionIntent(),
phrases: [
"Ask \(.applicationName)",
"Ask \(.applicationName) a question"
]
)
}
}
@available(iOS 16, *)
struct AskQuestionIntent: AppIntent {
static var title: LocalizedStringResource = "Ask question"
static var description = IntentDescription("Ask questions directly")
@Parameter(title: "Question", requestValueDialog: "What would you like to ask?")
var question: String
@MainActor
func perform() async throws -> some OpensIntent {
return .result(opensIntent: self, dialog: IntentDialog(stringLiteral: "some result"))
}
}
Here is How it looks like in ChatGPT:
And here is my app:
`
Post not yet marked as solved
This is a very long battle trying to solve an issue with an automation I created in the Shortcuts app. I have been facing this issue on my old phone SE2 and now it's the same on my 12. I am running IOS 16.5.1 with the latest security patches/ updates.
This issue has also been reported to apple support multiple times with no solution yet. I have tried restoring, deleting all apps., redownloading the Shortcuts app., Deleting the Siri Voices and redownloading them but nothing is helping!
I have included Screen and Video recording for this issue for the benefit of the reader I am also explaining the problem/ challenge here in text.
NOTE: I am also a VoiceOver user and have a sight impairment
Created a personal automation on the Shortcuts app. When any of 2 alarms is topped, get weather, text and speak text. While creating the automation and running it to test, the automation works flawless and the Siri voice used to speak text sounds just like it should. This is covered in the first video link.
The challenge: When the automation is triggered, i.e. when the alarm is stopped and the text is to be spoken; the Siri voice is all choppy and inconsistent. This is demonstrated in the second video.
P.S. It happens with all English Siri voices irrespective of Language selected in the automation i.e. Australia, India, United Kingdom, United States etc.
NOTE: It's the Siri voices I downloaded from: Settings/ accessibility/ Spoken content. Other voices downloaded work fine but they aren't as good and natural as Siri voices.
automation how it should be working:
https://www.youtube.com/watch?v=-7YxOVRf8WA
automation how it works when triggered:
https://www.youtube.com/watch?v=rq2rIJQV7cw&list=PL8vG-Fmt9t_lLgPAxlA8qaKVksgc9b3y6&index=2
Post not yet marked as solved
Currently my app is spelled with an y instead of a i and Siri keeps saying there are not shortcut because when I invoke my shortcut name using ("Use (.applicationName)") Siri alway put the i instead of the y
Post not yet marked as solved
Hi all
i want to create a shortcuts task, leting you choose from a number of menu's, where the chosen items will be added as photo keywords or captations to 1 or more subsequent taken pics.
the main problem is not being able to add the words, using this method:
(it's the Dutch version)
the other problem is that i would like to have the choise to take more pictures with a prompt.
could someone help me with this problem?
thanks a billion!
Post not yet marked as solved
Dear community,
I am having troubles to configure an Apple Shortcut with my Eve Aqua automatic irrigation system.
I want the shortcut to run every day at 9 PM, but I need it to check if it rained today or if it is going to rain tomorrow and then stop if its going to rain or was raining today.
Otherwise I would need for it to trigger the Eve Aqua scene I have configured which waters the grass for 30 minutes.
Does anyone know how I can accurate achieve this in a reliable way? So far I have configured "Get Current Weather at my address", also If Precipitation chance is greater than or equal to 70m, if precipitation amount is greater than or equal to 1mm".
But these conditions seem to be ignored...
Thanks a lot for your help!
Fernando
Post not yet marked as solved
This is Siri Intent before iOS 16.
func handle(intent: CustomIntent, completion: @escaping (CustomIntentResponse) -> Void) {
completion(CustomIntentResponse(code: .continueInApp, userActivity: nil))
}
This flow working fine.
This is AppIntent after iOS 16. There are 2 ways to continue in app
openAppWhenRun = true
ForegroundContinuableIntent Protocol only works in SwiftUI
But both are not notifying the main app its just opening app without activity. In SiriIntent we can notifiy Main App with completion(CustomIntentResponse(code: .continueInApp, userActivity: nil))
application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool
else its start with didfinishlaunching and we can get useractivity.
Is there any solution for after iOS 16 In AppIntent we can notify app and get NSUserActivity?
Post not yet marked as solved
Hi , how I can run my shortcut by tapping on button from widget?
Post not yet marked as solved
Hi, I have been exploring ideas on how to tap on a Quick Actions and not open the app, instead start a background API task. Is there a way to achieve this ?
Post not yet marked as solved
struct MeditationShortcuts: AppShortcutsProvider
{
AppShortcut(
intent: OCRIntent(),
phrases: [AppShortcutPhrase<OCRIntent>.init("OCR识别\(AppShortcutPhraseToken.applicationName)")],
shortTitle: "文字识别",
systemImageName: "checklist"
)
}
static var shortcutTileColor: ShortcutTileColor {
return .orange
}
}
Why packaging shortcut instructions in the above way will not be displayed in the shortcut instruction app?
Defining a phrase in literal terms will show, for example
struct MeditationShortcuts: AppShortcutsProvider
{
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OCRIntent(),
phrases: ["OCR识别\(.applicationName)"],
shortTitle: "文字识别",
systemImageName: "checklist"
)
}
static var shortcutTileColor: ShortcutTileColor {
return .orange
}
}
Post not yet marked as solved
I am trying to implement App Shortcuts for my app. I want to implement the same as Books. I am trying to do 2 things.
I want to set a custom image for each App Shortcut.
I want to set custom color for the Shortcuts background like orange in the Books App Shortcuts.
I am trying to implement in iOS 16.
Kindly share your ideas.
If at all possible, kindly share a snippet