I'm trying to add Siri support to my app for sending voice messages. I've implemented INSendMessageIntentHandling in my main app target.
It looks like it's getting as far as recording the voice message and passing my intent handler an INSendMessageIntent with an audio attachment, but I'm not able to read the attachment file.
func handle(
intent: INSendMessageIntent,
completion: @escaping (INSendMessageIntentResponse) -> Void
) {
if let attachment = intent.attachments?.first,
let audioFile = attachment.audioMessageFile,
let fileURL = audioFile.fileURL
{
// This branch runs
// fileURL is "file:///var/mobile/tmp/SiriMessages/89F738F7-6092-439A-B4FA-2DD9A99F0EED.caf"
let result = processMessageAudio(url: fileURL)
completion(result)
return
}
// This line isn't reached
completion(.init(code: .failure, userActivity: nil))
}
private func processMessageAudio(url: URL) -> INSendMessageIntentResponse {
var fileRef: ExtAudioFileRef?
if url.startAccessingSecurityScopedResource() {
logDebug("File access allowed")
} else {
// This branch runs
logDebug("File access not allowed")
}
defer {
url.stopAccessingSecurityScopedResource()
}
let openStatus = ExtAudioFileOpenURL(url as CFURL, &fileRef)
// openStatus is -54 (kAudio_FilePermissionError)
return INSendMessageIntentResponse(code: .failure, userActivity: nil)
}
I'm not sure what I'm missing. It looks like there should be an audio file, and Siri shows a preview of the audio for confirmation.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My app is associated with multiple web sites (e.g. myapp.com, myappbonus.com, *.myappbonus.com), and depending on the user's account setup they may use a different web site to manage their account. I'd like to have password autofill save the correct web site with their account info. Currently, all accounts appear to be getting saved by password autofill associated with myappbonus.com.
Is there any way to control which web site is saved with an account?
My app's lists "myapp.com" and "*.myappbonus.com" in the associated domains entitlement, and myapp.com, myappbonus.com, and every subdomain of myappbonus.com all return the .well-known/apple-app-site-association file with the "webcredentials" key specified.
myappbonus.com and its subdomains also include the "applinks" key, and have been for a while. I don't know how the app's behavior will be affected by specifying both "webcredentials" and "applinks" keys.
Thanks for any assistance.