Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Please help me for toast notification [Help] #162

Closed
mrtnetwork opened this issue Dec 8, 2022 · 4 comments
Closed

Please help me for toast notification [Help] #162

mrtnetwork opened this issue Dec 8, 2022 · 4 comments

Comments

@mrtnetwork
Copy link

I wrote a package for notification that you can see here
everything is ok but the action event not working ( other than the system type)

When I use another AMUID in the plugin that I get from Windows with the Get-StartApps command in Powershell, the action works fine.

with package mode with msix, I don't use any AMUID to display the notification, the icon and the name of the application are displayed correctly, but I don't receive the action event.

Manifest

<Application Id="mrt" Executable="mrt_application.exe" EntryPoint="Windows.FullTrustApplication">

 </uap:Extension>
          <com:Extension Category="windows.comServer">
          <com:ComServer>
            <com:ExeServer Executable="mrt_application.exe" Arguments="-ToastActivated" DisplayName="Toast activator">
              <com:Class Id="c1ca7cbb-0a44-44b5-8ded-8cd054d5365a" DisplayName="Toast activator"/>
            </com:ExeServer>
          </com:ComServer>
        </com:Extension>
        <desktop:Extension Category="windows.toastNotificationActivation">
          <desktop:ToastNotificationActivation ToastActivatorCLSID="c1ca7cbb-0a44-44b5-8ded-8cd054d5365a"/>
        </desktop:Extension>

YAML

msix_config:
  display_name: MRT NETWORK
  publisher_display_name: MRT
  identity_name: MRTNETWORK.MRT
  msix_version: 1.0.0.0
  logo_path: ..\logo2.png
  capabilities: internetClient, location
  certificate_path: ...\mrt_win.pfx
  certificate_password: ****
  toast_activator: #<-- toast notifications configuration
    clsid: c1ca7cbb-0a44-44b5-8ded-8cd054d5365a
    arguments: "-ToastActivated"
    display_name: "Toast activator"
  app_installer:
    publish_folder_path: C:\in_work\mrt_app\windows_installer

please help me, thanks

@YehudaKremer
Copy link
Owner

Hello @MohsenHaydari

Your package looks great 👍

Unfortunately, windows notification with flutter + msix is problematic (see #118).
I will take a look at this to see if it can be solved from the msix side.

@mrtnetwork
Copy link
Author

Hello @MohsenHaydari

Your package looks great 👍

Unfortunately, windows notification with flutter + msix is problematic (see #118). I will take a look at this to see if it can be solved from the msix side.

thank you

If I don't use AMUID in packed mode, the app name and icon are displayed correctly and my app doesn't open another window, it only opens if the app is closed, I think it is a different problem

@boyan01
Copy link

boyan01 commented Dec 9, 2022

I'm working on windows notification this week too. win_toast

Maybe you forgot to use CoRegisterClassObject to register INotificationActivationCallback.

In packed mode, the Activate and Dismissed callback of notifiation will useless. (And I don't known why...) But if you register the INotificationActivationCallback com interface. Then INotificationActivationCallback.Activate will be called and works fine.

An example code you can check here.

https://github.com/MixinNetwork/flutter-plugins/blob/main/packages/win_toast/windows/DesktopNotificationManagerCompat.cpp#L206-L260

@mrtnetwork
Copy link
Author

mrtnetwork commented Dec 10, 2022

I'm working on windows notification this week too. win_toast

Maybe you forgot to use CoRegisterClassObject to register INotificationActivationCallback.

In packed mode, the Activate and Dismissed callback of notifiation will useless. (And I don't known why...) But if you register the INotificationActivationCallback com interface. Then INotificationActivationCallback.Activate will be called and works fine.

An example code you can check here.

https://github.com/MixinNetwork/flutter-plugins/blob/main/packages/win_toast/windows/DesktopNotificationManagerCompat.cpp#L206-L260

<action activationType="protocol" arguments=``somthing:somthing'' content="Dismiss" />

When called from your app protocol like ``somthing:somthing'' in active arguments, I don't know why the arguments need : between values, maybe I didn't read well, anyway The problem was solved

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

No branches or pull requests

3 participants