I've been searching and haven't found many questions nor answers about sending audio files via iMessage Applications. I have been trying and am just not sure how to go about it. Here is a snippet of my code:
@IBAction func pressSend(_ sender: Any) {
let filePath = Bundle.main.path(forResource: "yaddadi", ofType: "m4a")
let fileURL = NSURL(string: filePath!)
if let conversation = activeConversation
{
conversation.insertAttachment(fileURL as! URL, withAlternateFilename: nil, completionHandler: nil)
}
}
When I run the app and click on the button that is attached to this function it inserts tiny little picture that appears to be nothing and I cannot even send that through the messages. Please help!