Hello! I'm writing to the Apple developers to request the addition of an API for downloading premium voices directly within the app. Currently, this can only be done via the settings, which is not convenient for our users. As a developer for an application where this plays a crucial role, I ask you to take this into consideration. Thank you!
Siri and Voice
RSS for tagHelp users quickly accomplish tasks related to your app using just their voice.
Posts under Siri and Voice tag
52 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello,
We're interested in using the PTT Framework with our PTT capable hardware, as the framework has intended. The problem is activating Siri with any of our specified Intent's doesn't work when the phone is locked.
The iPhone always says "You'll have to unlock your iPhone first".
Reading up on the problem, it seems pretty common in the fact that Apple doesn't allow Siri Intents to be executed while the phone is locked.
It's a sensible precaution by default, but there are countless threads of real use cases that users want to use Siri without unlocking (with PTT, or well, without).
There appears to be no options for PTT to enable this, any flags on the Siri Intent to allow benign App actions or queries, user UI configuration through Settings -> Siri & Search to manually allow it even when the phone is locked. Neither are there any entitlements (that I'm aware of) that would allow trivial and non-secure Siri App Intents.
The only advice we have for our users (and albeit against the intention of the limitation in the first place) is to: Disable Auto Lock, Disable Face ID and to Disable Passcode.
It is in fact 2024, and users do expect a better experience than this with Siri, or am I missing something?
So I'm working on a logging app that uses Siri to log diaper changes for babies. There are 3 types of diaper changes, wet, dirty, both.
I created a enum for these values in the intent definition file and made it configurable and resolvable.
in the resolve function, I added this line of code
public func resolveDiaperType(for intent: DiaperIntentIntent, with completion: @escaping (DiaperTypeResolutionResult) -> Void) {
let needsValue = intent.diaperType == .unknown
if needsValue {
completion(.needsValue())
} else {
completion(.success(with: intent.diaperType))
}
}
But as soon as .needsValue() is called, the UI will ask user to select one value, and then crash the app.
I tried removing a lot of different params and code blocks, needsValue is the only thing that's crashing for me. If I make the default diaperType parameter as .dirty instead of .unknown, it works.
Basically it won't let me work with an empty enum parameter.
I get the SIGABRT error and the app crashes.
I have like 4 intents. 3 of them uses enums. All 3 crash on the enum input UI. all 3 work correctly when the enum is given a value instead of .unknown.
The problem is, I NEED to ask user the type.
If I give it a default value and resolve it with .needsValue(), it still crashes.
I cannot ask the user for a value.
I haver made siri intents with enums input before. And those intents STILL WORK.
They were just made for older Xcode versions
Is this an Xcode bug?
Testing on iOS 17.2 simulator
Xcode 15.2
guard let fileURL = intent.attachments?.first?.audioMessageFile?.fileURL else {
print("Couldn't get fileNameWithExtension from intent.attachments?.first?.audioMessageFile?.fileURL?.lastPathComponent")
return failureResponse
}
defer {
fileURL.stopAccessingSecurityScopedResource()
}
let fileURLAccess = fileURL.startAccessingSecurityScopedResource()
print("FileURL: \(fileURLAccess)")
let tempDirectory = FileManager.default.temporaryDirectory
let tempFileURL = tempDirectory.appendingPathComponent(UUID().uuidString + "_" + fileURL.lastPathComponent)
do {
// Check if the file exists at the provided URL
guard FileManager.default.fileExists(atPath: fileURL.path) else {
print("Audio file does not exist at \(fileURL)")
return failureResponse
}
fileURL.stopAccessingSecurityScopedResource()
// Check if the temporary file already exists and remove it if necessary
if FileManager.default.fileExists(atPath: tempFileURL.path) {
try FileManager.default.removeItem(at: tempFileURL)
print("Removed existing temporary file at \(tempFileURL)")
}
// Copy the audio file to the temporary directory
try FileManager.default.copyItem(at: fileURL, to: tempFileURL)
print("Successfully copied audio file from \(fileURL) to \(tempFileURL)")
// Update your response based on the successful upload
// ...
} catch {
// Handle any errors that occur during file operations
print("Error handling audio file: \(error.localizedDescription)")
return failureResponse
}
guard let audioData = try? Data(contentsOf: tempFileURL), !audioData.isEmpty else {
print("Couldn't get audioData from intent.attachments?.first?.audioMessageFile?.data")
return failureResponse
}
Error:
FileURL: false
Audio file does not exist at file:///var/mobile/tmp/SiriMessages/BD57CB69-1E75-4429-8991-095CB90959A9.caf
is something I'm missing?
In the Apple video entitled Optimize CarPlay for vehicle systems, from WWDC23, the section on Audio explains that our apps should support "enhancedSiri"
I can find no documentation anywhere to support how a developer might implement enhancedSiri?
Thank you
Mike
Problem:
While foregrounded the app and you trigger siri to execute a voice command that you configured on your app it triggers twice with two activities instances of the same type which with the same states which then could potentially trigger twice an action
Steps To Reproduce:
Configure your plist to support an Scene
App Delegate to configure your default configuration
on the scene load as a root the ViewController
the view controller is only containing the logic to configure the voice shortcut and shows a button
after configuring the shortcut with the app open open siri and execute the voice command and the scene(_ scene: UIScene, continue userActivity: NSUserActivity) will be executed twice with the same activity type but different instances of the activity
Hi,
Recently I bought 2 HomePod minis and placed them in my kitchen and bathroom. I have noticed that they keep their alarms/reminders device-local and take priority over any other device.
For example I can hold up my phone, say something like "hey siri set alarm for 7am" and the kitchen echo will respond something like "none of your devices can do that" (obviously sound quality suffered from distance) or worse, it sets an alarm on the device not my phone, waking everyone in the household not just me.
Another annoying habit it has is to set a reminder on one device, then later I say something like "cancel my reminders", accidentally the other HomePod picks it up, says something like "I cancelled all your reminders" then a few minutes later the first HomePod will still remind me - so it's not even shared across HomePods.
Setting wake-up alarms gotten so bad and complicated (walk out of a room, whisper to the phone directly) I had to disable both HomePods from listening to "siri". Now all they are is expensive decoration (except when once a week we listen to some music on it).
Is there no way to make HomePods not to be the highest priority devices and use alarms/reminders from the phone (like it does with shopping lists)? This annoying experience I would expect from MS and Alexa maybe, but not Apple.
HI!
I'm using shortcuts commands to send http commands to my home automation system.
unfortunately from IOS16 onwards they only work when the button is pressed because if I ask Siri to execute a command I get a paragraph telling me that I don't have any devices configured in the "apple home" app.
I noticed this problem with Siri in Italian.
what can I do?
thank you
Our users are using Apple's native Voice Control feature: https://support.apple.com/en-us/HT210417
We want to enhance our accessibility experience by adding some additional voice controlled dialogs that show up specifically when Voice Control is enabled.
It can be determined if other Apple accessibility features are turned on via a check like UIAccessibility.isVoiceOverRunning, however there is no option for Voice Control (note, different than Voice Over).
How can I detect if a user is running Voice Control or not?
I want to add shortcut and Siri support using the new AppIntents framework. Running my intent using shortcuts or from spotlight works fine, as the touch based UI for the disambiguation is shown. However, when I ask Siri to perform this action, she gets into a loop of asking me the question to set the parameter.
My AppIntent is implemented as following:
struct StartSessionIntent: AppIntent {
static var title: LocalizedStringResource = "start_recording"
@Parameter(title: "activity", requestValueDialog: IntentDialog("which_activity"))
var activity: ActivityEntity
@MainActor
func perform() async throws -> some IntentResult & ProvidesDialog {
let activityToSelect: ActivityEntity = self.activity
guard let selectedActivity = Activity[activityToSelect.name] else {
return .result(dialog: "activity_not_found")
}
...
return .result(dialog: "recording_started \(selectedActivity.name.localized())")
}
}
The ActivityEntity is implemented like this:
struct ActivityEntity: AppEntity {
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "activity")
typealias DefaultQuery = MobilityActivityQuery
static var defaultQuery: MobilityActivityQuery = MobilityActivityQuery()
var id: String
var name: String
var icon: String
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(self.name.localized())", image: .init(systemName: self.icon))
}
}
struct MobilityActivityQuery: EntityQuery {
func entities(for identifiers: [String]) async throws -> [ActivityEntity] {
Activity.all()?.compactMap({ activity in
identifiers.contains(where: { $0 == activity.name }) ? ActivityEntity(id: activity.name, name: activity.name, icon: activity.icon) : nil
}) ?? []
}
func suggestedEntities() async throws -> [ActivityEntity] {
Activity.all()?.compactMap({ activity in
ActivityEntity(id: activity.name, name: activity.name, icon: activity.icon)
}) ?? []
}
}
Has anyone an idea what might be causing this and how I can fix this behavior? Thanks in advance
I'd like to build an AppIntent where the parameters are included in the initial invocation.
First-party example "Set a timer for 10 minutes" immediately sets new timer using the parameter 10 minutes.
Is this possible via AppIntents? Or do we have to invoke with "Set a timer" then give parameters via dialog: "for how long"? with user replying "10 minutes."
I'm working on an app for an accompanying toy that allows you do drop a marble on a self made track.
As a nice bonus I wanted to make it possible to drop a marble using Siri Shortcuts, Siri or the HomePod. So the new iOS 16 App Intents work great for this.
The App Intent documentation is bare, but I got the App Intent to work and it evens shows a custom error message when something goes wrong,
However I now want to promote the feature. SiriTipUIView is meant for this, however I'm seeing an issue. The application name is missing from the tips UI, instead the phrase starts with a space.
The code for the App Shortcuts
struct MyAppShortcutsProvider: AppShortcutsProvider {
static var appShortcuts = [
AppShortcut(intent: DropMarbleIntent(), phrases: [
"\(.applicationName) drop marble",
"\(.applicationName) drop a marble",
"Drop a \(.applicationName)",
"Drop \(.applicationName)"
])
]
}
The code for the SiriTipUIView (just for testing)
let tipView = SiriTipUIView()
tipView.setIntent(intent: DropMarbleIntent())
tipView.sizeToFitUsingConstraints()
tipView.allowsDismissal = true
presentedSubscription = tipView.publisher(for: \.isPresented).sink { isPresented in
if isPresented == false {
self.tableView.tableHeaderView = nil
}
}
tableView.tableHeaderView = tipView
This happens on any iOS 16 simulator and on an iPhone 13 Pro running the iOS 16 release version.
Am I missing something, or should I report a bug using feedback?