Created
September 16, 2016 21:19
-
-
Save bartkozal/e200e733e84b9e7b44125719b3b6e4a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func composeMessage() { | |
let conversation = activeConversation | |
let session = conversation?.selectedMessage?.session ?? MSSession() | |
let layout = MSMessageTemplateLayout() | |
layout.image = UIImage(named: "message-background.png") | |
layout.imageTitle = "iMessage Extension" | |
layout.caption = "Hello world!" | |
layout.subcaption = "Sent by /(conversation?.localParticipantIdentifier)" | |
var components = URLComponents() | |
let queryItem = URLQueryItem(name: "key", value: "value") | |
components.queryItems = [queryItem] | |
let message = MSMessage(session: session) | |
message.layout = layout | |
message.url = components.url | |
message.summaryText = "Sent Hello World message" | |
conversation?.insert(message) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment