Search code examples
iphoneios-app-extensionios10imessage

What is the difference between Apple's iMessage template or adding an extension to an existing app?


I have noticed this different regarding the creation of messages apps for iOS 10.

If you create a new project using iMessage Application choice on the new project's template, Xcode will create two targets, an app and an extension.

enter image description here

but the project is not able to run.

enter image description here

(see by this second picture that there is only one choice on the target selector at the bottom and that target is the extension).

When you create a normal app, like a single view app and then add a target that is an app extension of the type iMessage, you will have two targets there, the app and the extension.

My questions are:

Xcode iMessage's template is in fact creating just an extension, right? Not an app plus an an extension, correct?

If this is true, why in heavens name is Xcode creating the app target? What is the purpose of having an app target that compiles and appears on the products section with the extension .app if that is not in fact an app and will never run?

Or is in fact the extension just like a "remote control" running the code that is on the app? This is confuse, because by mistake I dragged a lot of content to the project and marked both targets to have them and the final thing doubled size, because the assets were copied to both targets.

The final question is: what will be submitted to Apple, just the extension or both?


Solution

  • My guess is to make the whole thing consistent. I mean when you do an other extension (keyboard, widget etc) this has to come with an app. Here the situation is a bit more complex, we can do an iMessage app that will run by itself, or as an extension of an existing app... So when they developed the SDK they had to keep both way, but that's just a guess :) Also I'm pretty sure that when submitting the iMessage app to the store, the main target will go with it, as it is the case with all other actual extensions.