4 Replies
      Latest reply on Sep 14, 2016 2:21 PM by skahri1429
      skahri1429 Level 1 Level 1 (0 points)

        I'm trying to use Local notifications in my iMessage extension, but there is no App Delegate for us to access the application property. Correct me if I'm wrong, but if I add an AppDelegate and blank ViewController to my iMessage app extension, won't I have to submit to the regular app store instead of the specialized Messages store? How do I access this functionality while keeping my app an extension?


        Any replies are appreciated.

        • Re: iMessage AppDelegate without creating separate app?
          pdm Apple Staff Apple Staff (1,770 points)

          Technically speaking, every extension has a parent containing app.  Even Sticker Pack Apps and iMessage Apps (as shown in Xcode's New Project panel) have an app that wraps the extension.  You can see in the project settings pane there are two targets in the list.  One is the extension itself, and the other is the app that contains it.  When you submit to iTunes Connect, you're always submitting a .ipa, and that .ipa always contains an app, and inside the app is your extension. The twist here is that the parent app is not shown on the user's home screen. 


          So now to your question.  UIApplication objects live in the parent iOS app.  For standalone iMessage Apps, there's no code in the parent iOS app, which means for these types of apps (either sticker packs or standalone iMessage apps) you cannot do what you want.  If you want to use UIApplication methods, then you have to have a real parent iOS app.  It would exist on the user's home screen.  So yes, you are correct, and you would have to make a "regular" app that would have to be submitted to the main App Store.