Launching iMessage App

Hello,

I am new to app development. I am trying to make an iMessage app. I created it and then added a SwiftUI view. It builds just fine and the view is visible on the storyboard, but the app is not present in iMessage on Simulator or on an actual device. What's wrong?

Thanks for any help.

import UIKit
import Messages
import SwiftUI
class MessagesViewController: MSMessagesAppViewController {
    var hostingController: UIHostingController<CalendarView>?
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    override func willBecomeActive(with conversation: MSConversation) {
        super.willBecomeActive(with: conversation)
        let swiftUIView = CalendarView()
        let hostingController = UIHostingController(rootView: swiftUIView)
        addChild(hostingController)
        view.addSubview(hostingController.view)
        hostingController.view.translatesAutoresizingMaskIntoConstraints = false
        NSLayoutConstraint.activate([hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)])
        hostingController.didMove(toParent: self)
        self.hostingController = hostingController
    }
    override func didResignActive(with conversation: MSConversation) {}
    override func didReceive(_ message: MSMessage, conversation: MSConversation) {}
    override func didStartSending(_ message: MSMessage, conversation: MSConversation) {}
    override func didCancelSending(_ message: MSMessage, conversation: MSConversation) {}
    override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) {}
    override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) {}
}

Plug your app into Console.app and filter by the process for your Messages App (target name). This should provide additional context.

If you are still having the issue or cannot pinpoint it, our engineering teams will need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a sysdiagnose and sample project, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Rico WWDR - DTS - Software Engineer

Launching iMessage App
 
 
Q