Hey everyone :wave: , I’m (finally) looking into C...
# compose-desktop
s
Hey everyone 👋 , I’m (finally) looking into Compose Desktop, and was trying to send a notification from a
Tray
. I’m following the tutorial on
compose-jb
, but the notification is not showing on my machine. I’m on MacOs BigSur 11.6. However, I can see that the
trayState.sendNotification
is correctly being called. My
build.gradle.kts
is the one from
templates/desktop-template
. https://github.com/JetBrains/compose-jb/blob/master/templates/desktop-template/build.gradle.kts (using 1.0.1 version, not rc2)
i
macOs should ask for permission to show notifications for
java
(or for your application, when you ship it as native distribution). Try to open macOs notifications, and there should be a request for it, with button "Allow"
s
Hey @Igor Demin, Thanks for replying so quickly. That makes a lot of sense! It doesn’t seem to solve it though 😕 I build a
dmg
, and tried it that way too but that also didn’t work. Although I did get a pop-up requesting if I wanted to allow notifications when I ran the installed
dmg
. I gave both
java
, and the installed
dmg
permission to send notifications.
message has been deleted
i
It seems it is a regression in JDK 16/17 🤔. Can you try it with JDK 15?
👍 2
s
Still not working for me. I have JAVA_HOME pointed to JDK 15, and Gradle/IntelliJ is pointing to JAVA_HOME. Before I was running on JDK 11 though, I just installed JDK 15 today to build the
dmg
. So it could not be 16/17 unless it’s baked into IntelliJ and I missed something (I’m double checking the ticket).
i
It seems yes, it is nothing to do with JDK 16/17. In my Notifications settings I have disabled notifications for one of the
java
some time ago. Do notifications work in other applications?
Gradle/IntelliJ is pointing to JAVA_HOME.
When we run via IDEA, IDEA uses JDK that is set in the
Settings/.../Gradle
(see the screenshot). But even with Java 11 it should work. If it doesn't work, and all notifications are turned on in the macOs settings, and the other applications are able to send notifications, then it is some rare incompatibility with the notifications mechanism that was implemented by JDK. By the way, IDEA probably also uses this mechanism. Do notifications work in it?
s
I was just thinking that. Any way I can force a notification from IDEA? It’s definitely worked on this machine in the passed, but I want to verify it’s still working properly in my current setup 😅
IntelliJ pops up separately in the notification settings though, but so did the Compose app if I installed it through the
dmg
.
i
I was able to force a notification in Android Studio Bumblebee, but not in IDEA. 1. open build.gradle 2. add some compilation error into it 3. run Gradle Sync 4. make Android Studio window inactive (Cmd-Tab) 5. wait for the notification about failed sync
s
I got my local Compose Desktop (1.0.1) project to work on JDK 11 & 15. Although I couldn’t get the notification to pop-up in AS 🤕
i
project to work
With or without notifications?
s
The notifications are working for me now on MacOs BigSur (11.6). At some point I got a notification asking me to allow
java
notifications, and after that it started working. However, I now have 3x
java
in my notification settings and not sure what the difference is. (Different JDK versions ?)
🎉 1
message has been deleted
i
Different JDK versions
Yes, those are different JDK versions. Usually Compose applications ship as
dmg
, and they have their own (single) name in Notification settings.
👌 1
s
Yes, I saw that I get a different app there also when I install it through
packageDmg
. It should also automatically request to allow notification for it, right? Let me also double check that.