Tôi đang gửi tin nhắn video trong Ứng dụng iMessage bằng cách sử dụng mã sau.iMessage App Tin nhắn video không hoạt động
@IBAction func didPress() {
if let conversation = activeConversation {
if let filePath = Bundle.main.path(forResource: "small", ofType: ".mp4") {
let filePathURL = NSURL.fileURL(withPath: filePath)
let layout = MSMessageTemplateLayout()
//layout.image = image
layout.mediaFileURL = filePathURL
let message = MSMessage()
message.layout = layout
//message.url = URL(string: "emptyURL")
conversation.insert(message, completionHandler: { (error: NSError?) in
print(error as Any)
} as? (Error?) -> Void)
}
}
}
Khi xuất hiện trong cửa sổ tin nhắn, nó phát thành công video có biểu tượng âm thanh bị tắt tiếng. Khi tôi nhấn vào biểu tượng âm thanh để mở âm lượng, thay vào đó hãy mở Bộ điều khiển chế độ xem mở rộng.
Đây có phải là lỗi iOS trong phần mở rộng ứng dụng iMessage không?
MSMessageTemplateKhông thể tùy chỉnh không thể tùy chỉnh. https://developer.apple.com/documentation/messages/msmessagetemplatelayout Như tài liệu nói "Không phân lớp lớp MSMessageTemplateLayout". –