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

XML Notification Not Working as expected #26

Open
frak0d opened this issue Apr 9, 2021 · 0 comments
Open

XML Notification Not Working as expected #26

frak0d opened this issue Apr 9, 2021 · 0 comments

Comments

@frak0d
Copy link

frak0d commented Apr 9, 2021

HOW ITS SUPPOSED TO LOOK :-
Annotation 2021-04-09 134340

HOW IT REALLY LOOKS :-
image

Contents of "CrashAlert.xml" :-

<toast>
	<visual>
		<binding template="ToastGeneric">
			<image placement="appLogoOverride" src="./warn.ico"/>
			<text>Potential Crash Warning</text>
			<text>It is Recomended to Save any Unsaved Progress within 30 Seconds.</text>
		</binding>
	</visual>
	<audio src="ms-winsoundevent:Notification.Reminder"/>
</toast>

C# Code (modified DesktopToast.Proxy) :-

using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;

namespace DesktopToast.Proxy
{
	class Program
	{
		static void Main(string[] args)
		{
			if (!args.Any())
			{
				Console.WriteLine(" Usage :-");
				Console.WriteLine(" notify.exe [AppName] [xml-file-path]");
				return;
			}

			string xml_path = @args[1];

			if (!File.Exists(xml_path))
			{
				Console.WriteLine("XML File Not Found !");
				return;
			}

			string readText = XDocument.Load(xml_path).ToString();

			var request = new ToastRequest
			{
				ToastXml = readText,
				ToastTitle = "DesktopToast WPF Sample",
				ToastBody = "This is a toast test.",
				ShortcutFileName = args[0] + ".lnk",
				ShortcutTargetFilePath = Assembly.GetExecutingAssembly().Location,
				AppId = args[0],
			};

			ToastManager.ShowAsync(request).Wait();
		}
	}
}

Does this library even support Windows 10 xml toasts ? or do i need windows 8 style xml ?

EDIT : Solved it by using absolute paths, but how can i use absolute paths in xml ?

and how to change the timeout ?

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

1 participant