In iMessage Extensions for iOS10, when the user taps on the interactive message bubble:
How can you save custom information in the sent message so, when tapped, the extension is able to get that custom information and recognize the type of the tapped message to respond accordingly?
Thanks!
Since this is an iOS 10 question, I hope the following answer in Swift will be helpful to others. (Original answer by @jmoukel, just converted to Swift by me).
let message = MSMessage()
guard let url = NSURL(string: "http://yourwebsite.com") else { return }
guard let urlComponents = NSURLComponents(URL: url, resolvingAgainstBaseURL: false) else { return }
urlComponents.setQueryItems([
"messageType": "1",
"username":"Jorge",
"userId":"99999",
"userPhoto":"http://yourwebsite.com/9999.jpg"
])
message.setURL(urlComponents.URL!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With