2

I recently built a new iOS 10 iMessage application. Originally, I thought I was only going to need to build a standalone iMessage application so I used the XCode template for doing that. Problem now is that I've realized you cannot open external urls from within an iMessage application but only from within it's parent app. So now I want to add a parent application but I can't figure out what's the best way to go about it.

The iMessage application template comes with a parent target but it doesn't seem to be set up the same way a normal iOS application is (i.e. theres no scheme set up for it, build phases are missing, etc.). I've tried adding an application to the XCode project but I just can't get it to work with the already created extension.

Anyone know the best way to create a parent application after you've already started a standalone iMessage app? Any help to point me in the right direction would be appreciated.

acmeyer9
  • 315
  • 1
  • 2
  • 13

3 Answers3

2

I wanted to do this for my app as well. Your best bet is to create a new iOS app target in your project, and create an iMessage app target for that. Then you can set up this new target to use your existing code.

But an important caveat if you've already published your standalone iMessage app to the App Store: the word I've gotten is that you can't change it later to have a parent application in that case.

If that's the case for you, you'll need to make a new app entry in iTunes Connect, and possibly update your current iMessage-only app to use a shared App Group Container for any data you need to migrate to the new app.

Matt Braun
  • 106
  • 2
  • Thanks for the info. I haven't submitted it yet luckily. Is there really no better way to do it then just creating a whole new target and extension? – acmeyer9 Sep 29 '16 at 01:35
  • I suppose you could try to do some pbxproj file surgery, but it's usually better to leave those edits to Xcode. Add a new iOS application target to your project, add the iMessage extension to that, and match the settings in the new extension target to your standalone app's. Then add the source files to the target as needed. – Matt Braun Sep 29 '16 at 03:41
  • 1
    After some manual copy and pasting and lots of warnings, I finally got it working. Thanks for the help! – acmeyer9 Sep 29 '16 at 14:53
2

For anyone who is specifically wondering whether or not you can change an iMessage only app into an app with an iMessage extension after you've submitted to the App Store, the answer is no.

Here's the relevant statement from Apple:

Can I update my standalone iMessage app or sticker pack to an iOS app with an iMessage or sticker pack extension? No, this is not possible once the app is live on the App Store.

Source: Apple FAQ

0

There's an answer here describing crawling up the responder chain to open a URL from a keyboard extension: https://stackoverflow.com/a/34426815/1060154

I can confirm that this approach works on iOS 10 for a standalone iMessage app.

I was also worried that this approach wouldn't pass iTunes store submission since it's getting around standard behavior, but I can also confirm that our stand alone iMessage app passed submission.

Community
  • 1
  • 1
MathewS
  • 2,267
  • 2
  • 20
  • 31