iOS messages extension how to switch host app directly
i think i found the answer.
there is no way with using
conversation.insert(message, completionHandler)
i think apple music and google maps are using
conversation.insertText("some url", completionHandler)
because i copied an URL after long press a message which is shared by apple music or google map
then i use the URL in my code
conversation.insertText("the URL", completionHandler)
it's working they did!!
iOS 10 messages extension - implementing didRecieve() and selectedMessage in Simulator
Once the receiver selects the message, willBecomeActive
is called and gives you the MSConversation
, which holds the selectedMessage
:
override func willBecomeActive(with conversation: MSConversation) {
super.willBecomeActive(with: conversation)
let message = conversation.selectedMessage
...
}
See: Helpful Apple sample
Is it possible to create a custom MSMessageLayout for iMessage app extension? If so, can some one provide me an example
Usually when you send a MSMessage
inside a MSMessageTemplateLayout
, the app icon is shown on the top-left corner (in your screenshot, it doesn't appear) so this makes me think that they probably use insertAttachment(_:)
. In this way the media is handled automatically by iMessage as it has been sent via sharing from any other apps.
Is there are way to open an iMessage extension from within the container app?
If anyone else is interested, as of Xcode 8.0 beta 6, MFMessageComposeViewController declares a property message of type MSMessage that lets you create an interactive message from within a springboard application so it can be used to achieve what I wanted in the first place. It does not, however, let you open a container app application.
Here's my code:
let message = MSMessage()
message.url = // Your message url
message.layout = MSMessageTemplateLayout()
message.summaryText = // Summary text
let messageViewControler = MFMessageComposeViewController()
messageViewControler.message = message
show(messageViewControler, sender: self)
Related Topics
Rotate a Imageview Around a Pivot Point in iOS
Cocoa Singleton and Shared Instances
Shift Avplayer Captions When Subview Overlaps Them
How to Access Index of Tabbar Item Using Swift
How to Handle Homophones in Speech Recognition
iOS + Swift, How to Redirect to Itunes Purchase Page
Cannot Set Color of Button's Label Inside Menu in Swiftui
Self.Type Cannot Be Directly Converted to Anyclass in Extension to Objective-C Class in Swift
How to Update Constraints Programmatically
Wake Up Application in Background Using Audiosession Like Alarmy iOS App
How to Use Key-Value Coding in Swfit 4.0
Uisearchcontroller Searchbar Delegate Not Working
Present Specific View Controller in Didreceiveremotenotification with Swift
How Is This Slide-Up Menu from the iPhone Messages App Implemented