Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Notifications not showing on OSX #38

Open
marcdel opened this issue Apr 14, 2023 · 3 comments
Open

Notifications not showing on OSX #38

marcdel opened this issue Apr 14, 2023 · 3 comments

Comments

@marcdel
Copy link

marcdel commented Apr 14, 2023

Apple M2
Ventura 13.3.1 (22E261)

Using the example app.

With newer versions of erlang and elixir, the app loads and functions fine, but none of the notifications are ever shown. I'm also not seeing any logs that would be helpful.

elixir: 1.14.3
erlang: 26.0-rc1
wxwidgets: stable 3.2.2.1 (bottled)

image

Also tried with a fresh Phoenix 1.7 app, and I'm not seeing notifications there either.

With the default .tool-versions file, the dbus application doesn't start:

[notice] Application dbus exited: :dbus.start(:normal, []) returned an error: shutdown: failed to start child: :dbus_bus_reg
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function :dbus_bus_reg.start_link/0 is undefined (module :dbus_bus_reg is not available)
            (dbus 0.8.0) :dbus_bus_reg.start_link()
            (stdlib 4.0.1) supervisor.erl:414: :supervisor.do_start_child_i/3
            (stdlib 4.0.1) supervisor.erl:400: :supervisor.do_start_child/2
            (stdlib 4.0.1) supervisor.erl:384: anonymous fn/3 in :supervisor.start_children/2
            (stdlib 4.0.1) supervisor.erl:1250: :supervisor.children_map/4
            (stdlib 4.0.1) supervisor.erl:350: :supervisor.init_children/2
            (stdlib 4.0.1) gen_server.erl:848: :gen_server.init_it/2
            (stdlib 4.0.1) gen_server.erl:811: :gen_server.init_it/6
@dominicletz
Copy link
Collaborator

I think notifications will show on MacOS only after the application is packaged.

dbus shouldn't start on macos at all. It's only used for linux so that error message is weird.

@osbre
Copy link

osbre commented Jul 14, 2023

Maybe it's due to the ARM architecture on Mac OS it detects the system as Linux with Dbus?

@dominicletz
Copy link
Collaborator

Just as a reminder to myself here:

In order for notifications to show up the Plist configuration must be "just right" - The problematic piece here is that there are usually two plists:

  1. Info.plist inside the application directory after installation /Applications/<Appname>.app/Contents/Info.plist
  2. Plist embedded in the beam.smp erlang binary

These need to match and they need to specify the same app id and some other needed values. Not all erlang versions ship with an embedded Info.plist that works for notifications. And Info.plists can not be inserted or removed after compilation.

My current solution for production is:

  • Have a custom OTP branch with the right Info plist

Future ideas could be:

  • Create a PR to erlang master that includes a template Info.plist that has a large xml filler and that then can be replaced inside the binary when creating the release installer using mix desktop.installer
  • Find a way to disable the embedded plist inside beam.smp (maybe changing the metadata key name is enough?)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants