imessage icon indicating copy to clipboard operation
imessage copied to clipboard

Contacts usage can't be granted due to lack of Info.plist entry

Open itsjunetime opened this issue 2 years ago • 0 comments

If the config file specifies contacts_mode: mac, mautrix-imessage fails to start up on my machine due to not being able to request contacts permission (it runs the [CNContactsStore requestAccessForEntityType:completionHandler:] method, but nothing is prompted to the user). I think this occurs due to the lack of embedded Info.plist including the key NSContactsUsageDescription (see this stackoverflow link). It seems that the Info.plist can be fairly easily embedded into the final binary with the go flags specified in this article under the section "The One Weird Linker Trick": https://pcable.net/posts/2020-11-14-inetaccesspolicy/

I suspect this doesn't appear when people use the self-hosted bridge through beeper-desktop due to the fact that the user has already granted permission to beeper-desktop, and mautrix-imessage is (maybe) running as a subprocess of beeper-desktop. It's also fairly easy to work around by specifying contacts_mode: disable.

I can probably file a PR at some point to fix this if it's desired, but I also understand if this is not expected to work since it's a weird use-case.

itsjunetime avatar Jun 29 '23 21:06 itsjunetime