Điểm qua felixrieseberg/electron-windows-notifications: 268 sao trên GitHub, viết chủ yếu bằng JavaScript. :zap: Send native Windows WinRT notifications from Electron
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Create native Windows toast and tile notifications for Windows 8, 8.1, and 10 using native bindings to WinRT (using NodeRT).
npm install --save electron-windows-notifications
From Electron v14 on, you'll have to require NodeRT modules in the main process. See https://github.com/NodeRT/NodeRT/issues/158 for details.
Usage
For more samples, check out the samples folder.
:memo: Want to respond to interactive notifications (with input fields, for instance)? You can send them with this module - and respond to them with electron-windows-interactive-notifications!
:memo: Want to check if you should send a notification?, accounting for the user notification state and quiet hours? Check out electron-notification-state.
ToastNotification
The constructor for the ToastNotification class accepts an options object with the following properties:
string template - The XML template for the notification. You can also call new Template() with few properties to customize your own XML template based on the default. See example: template.js
string[] strings - An array of strings to be used in your template. XML escaping is applied to all strings.
Date expirationTime - Time after which a toast notification should not be displayed.
string group - Group identifier for the notification.
string tag - Unique identifier of this notification within the notification group.
string appId - appUserModelId of the application for which the notification is sent. If not passed, it will be assumed to be a global property in Electron's main thread.
Tile notifications update the app's primary or secondary tiles. They require that the app is running inside the UWP model, which is possible on Windows 10 Anniversary Update and later. For more information, check out electron-windows-store. The constructor for the TileNotification class accepts an options object with the following properties:
string template - The XML template for the notification. You can also call new Template() with few properties to customize your own XML template based on the default. See example: template.js
string[] strings - An array of strings to be used in your template. XML escaping is applied to all strings.
string tag - Unique identifier of this notification within the notification group.
string tileId - If set, the given tile will be updated. Otherwise, the app's primary tile will be used.
The appUserModelId identifies application in Windows. In Electron, you can set it at runtime using the app.setAppUserModelId() method. If you don't pass it, this module will assume that it's a property on Electron's main thread. Unless running inside a UWP container, you probably want to pass it.
Mysterious Failures & XML Escaping
Microsoft follows the XML spec to the letter - and XML has escaping rules you might not be familiar with. If you're adding strings and properties to your template, consider just using the strings property in the constructor - it will automatically properly escape all input.
String replacement
Inside the module, util.format is used. It'll format the template in a printf-like format. The template is expected to hold zero or more placeholders. Each placeholder is replaced with the converted value from its corresponding argument. If the placeholder does not have a corresponding argument, the placeholder is not replaced. Supported placeholders are:
%s - String.
%d - Number (both integer and float).
%j - JSON.
%% - single percent sign ('%'). This does not consume an argument.
Đọc thêm về felixrieseberg/electron-windows-notifications ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/felixrieseberg/electron-windows-notifications là nguồn chính thức.
felixrieseberg/electron-windows-notifications có bao nhiêu sao?
felixrieseberg/electron-windows-notifications có 268 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/felixrieseberg/electron-windows-notifications. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
felixrieseberg/electron-windows-notifications có phải mã nguồn mở không?
Có — felixrieseberg/electron-windows-notifications phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/felixrieseberg/electron-windows-notifications.
felixrieseberg/electron-windows-notifications có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho felixrieseberg/electron-windows-notifications. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
felixrieseberg/electron-windows-notifications là gì?
felixrieseberg/electron-windows-notifications (felixrieseberg/electron-windows-notifications) là dự án JavaScript trên GitHub. Theo mô tả gốc: :zap: Send native Windows WinRT notifications from Electron
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về electron-windows-notifications?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về electron-windows-notifications.