1

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...

M.B.
  • 15
  • 5

1 Answers1

0

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.

Andy Dent
  • 17,578
  • 6
  • 88
  • 115
  • So, to confirm, you are saying that such app released on AppStore would not display the bug, correct? This bug is only showing when debugging with XCode, correct? – M.B. Jun 24 '19 at 19:00
  • You should do your own testing with a release build to prove it but yes, it's a side-effect of debugging with XCode – Andy Dent Jun 25 '19 at 07:11
  • It works! But Release version - with camera plist entries - still crashes... Would you recommend keeping "camera plist entries" in debug, and live with only the Release version being crash-free? – M.B. Jun 28 '19 at 23:06
  • "Still crashes" when you run the extension from iMessage alone or when you run from XCode? You CANNOT fully test extensions running from XCode - they will always crash hard after the call to dismiss() – Andy Dent Jun 29 '19 at 00:06
  • "Still crashes" when downloading app through TestFlight and running from iMessage... Inverting camera plist entries between debug and release - like explained above - seems to work to perfection... – M.B. Jul 01 '19 at 15:23