RFC: Migration from NSUserNotificationCenter to UNUserNotificationCenter on macOS #112

issue hebasto openend this issue on October 24, 2020
  1. hebasto commented at 1:10 pm on October 24, 2020: member

    Apple suggests to use UNUserNotificationCenter instead of deprecated NSUserNotificationCenter.

    I’ve played (on macOS 10.15) a bit with UNUserNotificationCenter and always getting the authorization error “Notifications are not allowed for this application”.

    Not sure, but it seems the root of this error is unsigned/unnotarized application.

  2. hebasto renamed this:
    RFC: Migration from NSUserNotificationCenter to UNUserNotificationCenter
    RFC: Migration from NSUserNotificationCenter to UNUserNotificationCenter on macOS
    on Oct 24, 2020
  3. hebasto added the label Brainstorming on Mar 5, 2021
  4. hebasto added the label macOS on Mar 5, 2021
  5. hebasto commented at 4:14 pm on February 13, 2024: member

    After a discussion in https://github.com/bitcoin/bitcoin/pull/29362, this issue has come to our attention again.

    In response to concerns raised in #114, it appears that migrating to the new UNUserNotificationCenter remains the only viable option. Therefore, I conducted further research and discovered the following:

    The UNUserNotificationCenter requires two conditions to be met in order to be granted permissions from the OS:

    1. The software must be bundled. **
    2. The software must be signed.

    This means that running ./src/qt/bitcoin-qt will not generate any notifications. Users must bundle it using make deploy, self-sign it with codesign -s - ./Bitcoin-Qt.app, and then run it using open ./Bitcoin-Qt.app.

    If these limitations are acceptable for macOS users and developers, I am ready to continue working in this direction.

    ** Notes:

    1. Our current hack with the substitution of the bundleIdentifier method does not help.
    2. https://developer.apple.com/forums/thread/679326
    3. https://forums.developer.apple.com/forums/thread/724249

    cc @Sjors @fanquake @theuni @achow101 @luke-jr @johnsBeharry

  6. Sjors commented at 11:29 am on February 15, 2024: member

    I think (2) is fine. We already sign the release build, and anyone who can compile from source can run the extra codesign command (maybe as part of make deploy?).

    If (1) just means that they have to use make deploy in order to get notifications working, that seems fine.

  7. alfonsoromanz commented at 10:32 am on February 22, 2024: contributor
    I was not familiar with the process of bundling and signing the application, however I ran the commands mentioned (make deploy, codesign -s - ./Bitcoin-Qt.app, and open ./Bitcoin-Qt.app) and the app ran with no issues. Having said that, I don’t see an issue in having to run those commands in order to make notifications work when compiling the code
  8. fanquake referenced this in commit d3c76a2e87 on Mar 6, 2024
  9. fanquake referenced this in commit 8b7630cb1f on Mar 7, 2024
  10. fanquake referenced this in commit 67fb94ce42 on Mar 7, 2024
  11. kevkevinpal referenced this in commit 474d486752 on Mar 13, 2024
  12. kevkevinpal referenced this in commit ebc3c67d85 on Mar 13, 2024
  13. janus referenced this in commit 891a7edb19 on Apr 6, 2024
  14. luke-jr referenced this in commit 8d3448c59b on Jun 13, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-11 04:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me