Extracting the Updated Title from Voice Memos via Share Extension

Hello,

I am developing a feature for my app using a Share Extension to import voice recordings from Apple's Voice Memos app. My objective is to capture the title (sometimes user-modified) of the recording when it is shared to my app via the Share Extension.

While I am able to extract the default metadata (such as location-based titles) of the recordings, I am facing difficulties in accessing the titles that users have manually edited within the Voice Memos app. For example, if a user renames a memo to "Dinner with friends" this updated title does not seem to be accessible from the metadata provided when the memo is shared to my extension. Instead, I am only able to retrieve the original, automatic title such as "New Recording 19" or a street address.

Through testing, I've observed that when sharing a voice memo via the system share sheet to apps like Mail, the updated title is included as the subject of the email. This indicates that the updated title is available somewhere within the share sheet's context.

Could anyone provide guidance on how to access this updated title from the shared voice memo? Is there a specific type identifier or a property of NSExtensionItem that I should be using to retrieve this piece of information?

Here's a snippet of how I am currently accessing the shared content:

for item in self.extensionContext?.inputItems as? [NSExtensionItem] ?? [] {
    for attachment in item.attachments ?? [] {
        if attachment.hasItemConformingToTypeIdentifier(UTType.audio.identifier) {
            // Processing the attachment
        }
    }
}
Extracting the Updated Title from Voice Memos via Share Extension
 
 
Q