notify-py icon indicating copy to clipboard operation
notify-py copied to clipboard

Unable to re-enable notifications for specific application name.

Open ms7m opened this issue 5 years ago • 4 comments

Reference

https://github.com/dynobo/normcap/issues/87

Looks like if a user manually "turns off" the notification sent by notify-py. They are unable to "re-enable". Need to find a workaround to allow the user to have the option to re-enable in the Windows Settings..

Current workaround is to simply change the application_name to something else each time you send a notification or when first initializing the Notify object..

ms7m avatar Nov 11 '20 04:11 ms7m

I just looked into this problem. Seems like to show up in the windows settings "Notifications & Actions" in the "Get notfications from these apps" section, the application triggering the notfication needs an AppID, to be more precise a System.AppUserModel.ID.

This is AppID usually is added by software installer. But if you add a shortcut to the StartMenu, and AppID is generated, too! In this case, the path to the executable is the AppID. To test that, run Get-StartApps in powershell. This will output programs along with their AppID.

This AppID then has to be used in notify-py:

        notification = Notify()
        notification.application_name = "MyProgrammsAppID"

After the first notification is shown, the setting will show up in "Notifications & Actions". You can easily test that this works, by picking one AppID of the Get-StartApps, which App not yet has an entry in the notification settings, and trigger an notification with notify-py using that AppID.

Here's the blog post that helped me most to figure that out.

I see three options how to mitigate this issue for notify-py

  1. Try to integrate the automatic creation of an AppID as part of the library
  2. Offer an additional function for creating the AppID which accepts necessary arguments, like path to the executable, a name, and a path to icon
  3. Leave the implementation part out of notfiy-py and just provide docu for the libs users pointing them in the right direction.

What do you think? :-)

dynobo avatar Nov 28 '20 22:11 dynobo

Thank you so much for looking into this!

Reading that blog post really clears some stuff up.

I think option 3 is the best course; I can't find anything on automatically creating an AppID (and make it show up in Get-StartApps unless it's created in VS/Wix, exported to a .msi and manually ran by the user; and that seems to be a big-no-no to install apps like that.

On option 2 -- reading that blog and doing some testing, it seems that there is no restrictions on using any AppID that's listed. This allowed me to send notifications through typical system applications. It looks like it wouldn't need any extra arguments; just simply the AppID that was registered with the installed executable (if you want to go through the custom route).

Speaking of that method, it's a possible option to run notifications through "This Computer", and handle notification settings through "This Computer" in the settings. But I'm weary of this, as it may confuse the user on who is sending the notifications. image

thanks for your help!

ms7m avatar Nov 29 '20 08:11 ms7m