Search code examples
swiftxcodeinfo.plistimessagemsmessage

MSMessageLiveLayout freeze/crash in transcript when info.plist contains privacy request


I have an iMessage extension using MSMessageLiveLayout for messages. I want the extension to access microphone. Adding in info.plist "Privacy - Microphone Usage Description" with correct value causes the liveMessages in transcript to freeze/crash when the extension is closed. Removing the Privacy request from info.plist makes the liveMessages in transcript to work as intended...

To reproduce the problem, just download Apple's "ice cream" iMessage sample extension here: https://developer.apple.com/documentation/messages/icecreambuilder_building_an_imessage_extension

then modify the following 2 lines of code: In the "func composeMessage(...)" add the following:

 let layout = MSMessageLiveLayout(alternateLayout: alternateLayout)

then add in the info.plist any of the following:

  • Privacy - Camera Usage Description
  • Privacy - Location Always Usage Description
  • Privacy - Microphone Usage Description

note that the following privacy request does not cause the crash/freeze: "Privacy - Location When In Use Usage Description"

I expect that quitting the extension does not cause each liveMessage in transcript to freeze/crash. But this is what happens. Any help would be welcome...


Solution

  • I have experienced the same thing with the camera plist entries.

    It's an XCode bug, confirmed by Apple. You cannot do anything about it - once you have those entries in there you have crashes when you try to debug with XCode.

    In my collection of iMessage samples I have a sample which explores this a bit further. It uses different plists so the Debug doesn't have camera permission.