Grzegorz Aperliński
Grzegorz Aperliński

Reputation: 918

Is there are way to open an iMessage extension from within the container app?

So far I've been encountering scenarios where you can launch the embedding app from the extension using the openURL: method, but is there a way to achieve the opposite?

I'm interested in knowing whether it would be possible to do something in my container app that creates an MSMessage instance and launches my iMessage app extension. Is this doable?

Upvotes: 2

Views: 1697

Answers (2)

Grzegorz Aperliński
Grzegorz Aperliński

Reputation: 918

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)

Upvotes: 5

ice.cube
ice.cube

Reputation: 483

Unfortunately, this is not currently possible. You can read it in this thread: https://forums.developer.apple.com/thread/50375

Upvotes: 2

Related Questions