Open ErraticFox opened 3 years ago
Update: The current code I'm using right now seems to have progress
import { ToastNotification, ToastNotificationManager, ToastTemplateType } from 'windows.ui.notifications'
const notificationManager = ToastNotificationManager
const template = ToastTemplateType.toastImageAndText01
const toastXml = notificationManager.getTemplateContent(template)
const toast = new ToastNotification(toastXml)
notificationManager.createToastNotifier('7E46BD40-39C6-4813-B414-019AD1122333').show(toast)
I am using a random GUID for now. But this now gives me the error
$ ts-node index.ts
Error: Cannot find module 'windows.data.xml.dom'
Require stack:
- C:\Users\errat\Desktop\NodeRT Output\windows.ui.notifications\lib\main.js
Though I went ahead and installed this in my project and the build process was successful, but I'm stumped now and I don't know where to go from here.
UPDATE 2: I finally got a notification to appear. I noticed the error was coming from the manually built module I created, so I switched back to the one I am using from NPM and it worked fine.
My only question is, how can I manually build the modules from NodeRT UI and have them include the other packages like windows.data.xml.dom
?
Hello, I've successfully manually built my NodeRT package, which was
windows.ui.notifications
. Though, even with TypeScript support and the Microsoft JavaScript example, I'm not able to create a toast notification.Here's the example Microsoft provides:
which gives me the error
so I tried changing it around to
ToastTemplateType
(as well as typescript telling me to) and then I get aBad arguments: no suitable overload found
. I've console.logged a lot of the elements in hopes of a solution and I've hit multiple different errors trying multiple different things, but I've not yet found a way to trigger the toast notification.