Giter VIP home page Giter VIP logo

desktop-toasts's Introduction

desktop-toasts

Samples for Win32 desktop apps using toast notifications with COM activation.

This sample demonstrates how a desktop app can display a toast notification and respond to events generated by the user's interaction with the toast.

This sample is provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs.

How to use the sample...

Desktop Bridge

  1. Open the project in VS
  2. Set the DesktopToastsPackageProject as the startup project
  3. Deploy

Toasts will work out-of-the-gate thanks to Desktop Bridge!

Classic Win32

  1. Install WiX Toolset if you haven't yet
  2. Open the project in VS
  3. Build the SetupProject
  4. Install the generated MSI from the bin/Debug folder
  5. Launch the Desktop Toasts app from the Start menu

After you've installed with the MSI once, you can debug straight from Visual Studio. Installing via the MSI creates the Start menu shortcut with the AUMID and COM CLSID so your notifications can appear and be actionable.

If you don't install the MSI first, toasts will not appear.

desktop-toasts's People

Contributors

andrewleader avatar darktears avatar michaelgoulding avatar tfennel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktop-toasts's Issues

Action Center Toast Notification without Shortcut

https://stackoverflow.com/questions/60495405/action-center-toast-notification-without-shortcut

Everything works perfectly as expected but I wonder one thing. Is it possible to register the ToastActivator without creating a shortcut? This program is going to be used on an internal enterprise network and I don't intend for it to have any UI. It'll be launched by the Task Scheduler, check a web service and send toast messages to the user when they apply.

If I must have a shortcut, the best UX I can think of is to just display an about dialog and exit.

Issue Creating Scheduled Toast Notifications

Hello,

Could you test creating scheduled toast notifications without ever calling the CreateToastNotifier.Show() function?

If my app just creates scheduled toast notifications, it doesn't seem to work. One thing I tested was creating a build that creates notifications immediately using .show(), then replacing it with the one that uses AddToSchedule and then it starts working. There must be something that .show() is doing that AddToSchedule isn't, because until I call show() I never see my app in the Notification & Actions section of the Windows Settings. But, I don't see anything in the documentation on scheduled notifications that indicate this....

https://github.com/MicrosoftDocs/windows-uwp/blob/docs/windows-apps-src/design/shell/tiles-and-notifications/scheduled-toast.md

Doesn't work...

            var toast = new ScheduledToastNotification(toastContent.GetXml(), DateTime.Now.AddSeconds(5));
            DesktopNotificationManagerCompat.CreateToastNotifier().AddToSchedule(toast);

Will work...

                ToastNotification toast = new ToastNotification(toastContent.GetXml());
                DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);

                var toast = new ScheduledToastNotification(toastContent.GetXml(), DateTime.Now.AddSeconds(5));
                DesktopNotificationManagerCompat.CreateToastNotifier().AddToSchedule(toast);

How to not use Wix?

In the guide, it stating that Wix can be used as installer. But the other method is not explained.
I am new to Windows development and haven't used Wix before. Is there a way to continue without adding this dependency ?

Step 5.1: WiX Installer
If you're using WiX for your installer, edit the Product.wxs file to add the two shortcut properties to your Start menu shortcut as seen below....

I am using the latest version of Windows 10 :
(Windows 10, version 1903)

with latest version of Visual Studio 2017
(15.9.160

and Windows 10 SDK
(10.0.18362.0)

Custom audio for toast notification is not working for desktop bridge application

Custom audio for toast notification is not working for desktop bridge application

  • We have desktop bridge app

  • Trying to set custom audio for toast notification
    `
    ToastContent toastContent = new ToastContent()

          {
              Visual = new ToastVisual()
              {
                  BindingGeneric = new ToastBindingGeneric()
                  {
                      Children =
                      {
                          new AdaptiveText()
                          {
                              Text = title
                          }
                      }
                  }
              }
          };
    toastContent.Audio = new ToastAudio()
    {
        Src = new Uri("ms-appx:///Assets/Audio/sound.m4a")
    };`
    
  • we tried with more options with creating URI object like below:
    `Src = new Uri("ms-appx:///Asset/sound.wav")

    Src = new Uri(@"ms-appx:///Asset/sound.wav")

    Src = new Uri("ms-appx:///xx/Asset/sound.wav")
    Src = new Uri("pack://application:,,,/LibraryName;component/Asset/sound.wav")
    Src = new Uri("pack://application:,,,/Asset/sound.wav")
    Src = new Uri("ms-appdata:///local/sound.wav")
    Src = new Uri("ms-appdata:///temp/sound.wav")
    Src = new Uri(@"C:\Final\sound.wav")
    Src = new Uri("ms-appdata:///local/sound.wav")
    Src = new Uri($"pack://ms-appx:///Asset/sound.wav")`

with all options - its not working
Also we tried with creating Appx package with above URI but still same problem.
We are getting default sound or invalid URI errors

Note: It works properly with core UWP application

Notifications are not showing - How to deploy?

I tried to follow the instructions but i am not sure what to do after deploying. There is no release folder.

Desktop Bridge
Open the project in VS
Set the DesktopToastsPackageProject as the startup project
Deploy
Toasts will work out-of-the-gate thanks to Desktop Bridge!

when i run the solution from debug, i clicked on "pop toast", nothing is showing. No notifications or anything.

I am using the latest version of Windows 10 :
(Windows 10, version 1903)

with latest version of Visual Studio 2017
(15.9.160

and Windows 10 SDK
(10.0.18362.0)

LNK2019 unresolved external symbol

I am recieving the LNK2019 unresolved external symbol when running the project for c++ win22 plugin for development of notification plugin for flutter! I have #include the DesktopNotificationManagerCompat.h file and copied the files to the include directory, but I seem the project isn't able to detect the definition of the Hresult function defined in the related CPP file. The project used Cmake for the dependencies. Request urgent support in this issue.

Feature request

It would be great for the library to support a custom timeout period for when it's displayed by the Action Center. And by that I mean that after the message pops up in the Notification Area and the user closes it, it would be a great feature to have the message stay in the Action Center a little longer.

Default App Logo size issue - C# Win32 Desktop App

I'd like to know what size the App Icon needs to be in order to properly display without padding when not using the AppLogoOverride. Currently no matter what I do the icon appears with a blue padded background.

image

How do I get rid of the blue padding?

Unable to compile after upgrade to Windows 10 1903

After upgrading to Windows 10 1903 I am no longer able to compile this example.

I am getting the following warnings:
The referenced component 'Windows.Data' could not be found.
The referenced component 'Windows.Foundation' could not be found.
The referenced component 'Windows.UI' could not be found.

And errors where code is dependent on the above assemblies.

These files were earlier in system32 but seems to have been removed from 1903. I have not been able to fin a nuget package that includes them.

I also updated to Visual Studio 16.0.3 to 16.1.1 but I don't think that this is the problem.
I have also been having problems building the progress example on a Windows 2016 build server: https://stackoverflow.com/questions/55899493/toastnotification-does-not-contain-a-definition-for-data-on-windows-server-2

Sending dropdown value in button querystring.

Hello, glad to see you are working on this.

Before you revamped your C# example, there was a dropdown example.

I'm in the process of converting that example to a console app, but I'm having an issue.

I want to send the value of the dropdown box in the invokedArgs activation callback.

I'm trying to do something like:

new ToastButton("Submit", "action=" + ToastSelectionBox.Value??????)

In your example, you simply had 'action=answer', which seemed like magic to me.

I don't know how to retrieve the value of the selection box, and the documentation doesn't explain this part as far as I know.

Any ideas?

In the documentation, the code for the button is simply left blank.

https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/adaptive-interactive-toasts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.