activeConversation is always nil while developing iMessage App

71 Views Asked by At

When I create a sample iMessage app project and run it on my device, it consistently displays the error message 'Error creating the CFMessagePort needed to communicate with PPT.' Additionally, when I attempt to print the value of 'activeConversation,' it always returns 'nil.

I am expecting that activeConversation shouldn't be nil.

2

There are 2 best solutions below

0
Raja Talha On BEST ANSWER

I was actually developing an app in which I wanted to send a message from the app when a user taps on a button. I intended to send a message directly from my extension, but I encountered an error where 'activeConversation' returned 'nil,' even though I expanded the screen and the message wasn't being sent. I resolved this issue by removing navigation controller from the initial view controller. When I add navigation controller to initial view controller it always gives me nil value of activeConversation.

0
Warpling On

Also if you specify your app to be a Sticker app in the info.plist using

<key>MSSupportedPresentationContexts</key>
<array>
  <string>MSMessagesAppPresentationContextMessages</string>
  <string>MSMessagesAppPresentationContextMedia</string>
</array>

and not just a plain Messages app, activeConversation will return nil