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

[v3] Notifications API #4098

Open
wants to merge 98 commits into
base: v3-alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
32839bd
initial notification impl
popaprozac Feb 20, 2025
274511c
update log message
popaprozac Feb 21, 2025
f694ad2
service and minor refactor
popaprozac Feb 22, 2025
cc524d7
update example
popaprozac Feb 22, 2025
87f15ce
refactor
popaprozac Feb 22, 2025
91f1704
cleanup
popaprozac Feb 22, 2025
01fa307
windows impl
popaprozac Feb 23, 2025
c7d54e2
remove app event
popaprozac Feb 23, 2025
7757eae
standalone example
popaprozac Feb 23, 2025
9f39577
add comments
popaprozac Feb 23, 2025
47a0977
add overwrite and remove notification category
popaprozac Feb 23, 2025
6d44068
save notification categories to registry
popaprozac Feb 23, 2025
ab9c460
quick fixes
popaprozac Feb 23, 2025
27e512d
add data option to basic notification
popaprozac Feb 23, 2025
f8647ff
update min macos version
popaprozac Feb 23, 2025
c1230d4
update win impl to match
popaprozac Feb 23, 2025
9eab58f
update comments
popaprozac Feb 23, 2025
cc760a1
test data with toast
popaprozac Feb 23, 2025
978a982
don't add title or body quite yet
popaprozac Feb 23, 2025
bf4222c
update example
popaprozac Feb 24, 2025
c904433
update example
popaprozac Feb 24, 2025
983c25f
rw safety
popaprozac Feb 24, 2025
1e3511c
fix deadlock
popaprozac Feb 24, 2025
3dbf058
update comments
popaprozac Feb 24, 2025
be716fc
fix input id
popaprozac Feb 25, 2025
8da9981
for review
popaprozac Feb 25, 2025
e8ad42a
switch to callback style
popaprozac Feb 25, 2025
8bbe381
Merge branch 'v3-alpha' into notifications_darwin
popaprozac Feb 25, 2025
67adc45
update example
popaprozac Feb 25, 2025
253f672
init linux
popaprozac Feb 25, 2025
135defc
init test linux
popaprozac Feb 25, 2025
7bbc275
fix windows
popaprozac Feb 25, 2025
fa498f1
encode user data on windows
popaprozac Feb 25, 2025
050e4ef
fix default complex action
popaprozac Feb 25, 2025
60c1a86
update example
popaprozac Feb 25, 2025
10ae1f6
export config from app
popaprozac Feb 25, 2025
a4c4ab6
add id to macOS payload
popaprozac Feb 25, 2025
acad85e
update example
popaprozac Feb 25, 2025
60ae0c1
test linux userInfo
popaprozac Feb 26, 2025
47e5b10
add debug
popaprozac Feb 26, 2025
5ad3d73
wrangle variants
popaprozac Feb 26, 2025
e86cf68
linux?
popaprozac Feb 26, 2025
db2cab7
grab icon from app for notifications on windows
popaprozac Feb 26, 2025
e216b3e
set icon
popaprozac Feb 26, 2025
207b162
Merge branch 'notifications_darwin' of github.com:popaprozac/wails in…
popaprozac Feb 26, 2025
3bdb3dd
use app icon
popaprozac Feb 26, 2025
a807c26
better interop with obj-c
popaprozac Feb 27, 2025
ad74972
can you tell i'm not a go programmer?
popaprozac Feb 27, 2025
d9af6de
ignore bindings notification callback
popaprozac Mar 3, 2025
833d8ec
refactor macos
popaprozac Mar 5, 2025
e4ec06a
update example
Mar 14, 2025
1e67e94
rename auth func
popaprozac Mar 15, 2025
1fa6894
//
popaprozac Mar 15, 2025
e46abdc
update example
popaprozac Mar 15, 2025
2cb0dac
set default action id on MATE
popaprozac Mar 15, 2025
6d15f08
Merge branch 'v3-alpha' into notifications_darwin
popaprozac Mar 15, 2025
e810d6a
tidy
popaprozac Mar 15, 2025
e4e24a0
clean
popaprozac Mar 19, 2025
b60ef77
coderabbit impr
popaprozac Mar 19, 2025
ee885fe
fix mem crash
popaprozac Mar 19, 2025
4af058b
more cleanup
popaprozac Mar 20, 2025
58b5c10
Merge branch 'v3-alpha' into notifications_darwin
popaprozac Mar 20, 2025
25256f7
allow only one notification service per app
popaprozac Mar 20, 2025
d98f528
Merge branch 'notifications_darwin' of github.com:popaprozac/wails in…
popaprozac Mar 20, 2025
bd85738
fix err message
popaprozac Mar 20, 2025
c58709c
lock registry access/writes
popaprozac Mar 20, 2025
b1db2bb
add missing error
popaprozac Mar 20, 2025
88f1336
reorg platform impl
popaprozac Mar 20, 2025
94f245f
bug fix
popaprozac Mar 20, 2025
e55bf8d
linux bug fix
popaprozac Mar 20, 2025
9adeef2
fix linux and remove dup code
popaprozac Mar 20, 2025
5dc7bd9
refactor/simplify linux
popaprozac Mar 20, 2025
be1da68
avoid deadlock on win
popaprozac Mar 21, 2025
ef3b7d2
pass service options
popaprozac Mar 22, 2025
81b40d2
ensure exactly one delegate created
popaprozac Mar 22, 2025
f6a5bed
windows err handling
popaprozac Mar 22, 2025
b2b8f14
windows err handling
popaprozac Mar 22, 2025
f870dcc
handle notif content errors
popaprozac Mar 23, 2025
9948cee
monitor dbus connection
popaprozac Mar 23, 2025
ace4f70
fix channel cleanup linux
popaprozac Mar 23, 2025
448c78b
rewrite and simplify linux impl
popaprozac Mar 23, 2025
5ddb27f
move chan creation on macos and handle linux shutdown
popaprozac Mar 23, 2025
a683918
remove deadlock
popaprozac Mar 23, 2025
9a45423
follow dbus spec
popaprozac Mar 24, 2025
7f496c9
fix linux note
popaprozac Mar 24, 2025
1f82166
ensure cat id is set for macOS and other rabbit suggestions
popaprozac Mar 24, 2025
b102279
update example
popaprozac Mar 24, 2025
d25f923
wait on dbus
popaprozac Mar 25, 2025
276c653
update example
popaprozac Mar 25, 2025
7d0f7f4
revert linux wait and update payload on win
popaprozac Mar 25, 2025
af5abda
update example
popaprozac Mar 25, 2025
1db65a8
stage docs
popaprozac Mar 27, 2025
743882a
update docs/changelog
popaprozac Mar 27, 2025
1022f47
fix docs
popaprozac Mar 27, 2025
bd5c82e
fix docs
popaprozac Mar 27, 2025
b313f2c
fix docs
popaprozac Mar 27, 2025
9a41b0c
move icon method, impl interface, check compat, don't panic!
popaprozac Mar 30, 2025
75dbe85
remove comptime check
popaprozac Mar 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions v3/examples/notifications/frontend/Inter Font License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

import * as Service from "./service.js";
export {
Service
};

import * as $models from "./models.js";

/**
* NotificationAction represents an action button for a notification
* @typedef {$models.NotificationAction} NotificationAction
*/

/**
* NotificationCategory groups actions for notifications
* @typedef {$models.NotificationCategory} NotificationCategory
*/

/**
* NotificationOptions contains configuration for a notification
* @typedef {$models.NotificationOptions} NotificationOptions
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Create as $Create} from "@wailsio/runtime";

/**
* NotificationAction represents an action button for a notification
* @typedef {Object} NotificationAction
* @property {string} id
* @property {string} title
* @property {boolean} [destructive]
* @property {boolean} [authenticationRequired]
*/

/**
* NotificationCategory groups actions for notifications
* @typedef {Object} NotificationCategory
* @property {string} id
* @property {NotificationAction[]} actions
* @property {boolean} [hasReplyField]
* @property {string} [replyPlaceholder]
* @property {string} [replyButtonTitle]
*/

/**
* NotificationOptions contains configuration for a notification
* @typedef {Object} NotificationOptions
* @property {string} id
* @property {string} title
* @property {string} [subtitle]
* @property {string} body
* @property {string} [categoryId]
* @property {{ [_: string]: any }} [data]
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

/**
* CheckNotificationAuthorization checks current permission status
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function CheckNotificationAuthorization() {
let $resultPromise = /** @type {any} */($Call.ByID(2789931702));
return $resultPromise;
}

/**
* RegisterNotificationCategory registers a category with actions and optional reply field
* @param {$models.NotificationCategory} category
* @returns {Promise<void> & { cancel(): void }}
*/
export function RegisterNotificationCategory(category) {
let $resultPromise = /** @type {any} */($Call.ByID(2679064664, category));
return $resultPromise;
}

/**
* RemoveAllDeliveredNotifications removes all delivered notifications
* @returns {Promise<void> & { cancel(): void }}
*/
export function RemoveAllDeliveredNotifications() {
let $resultPromise = /** @type {any} */($Call.ByID(384520397));
return $resultPromise;
}

/**
* RemoveAllPendingNotifications removes all pending notifications
* @returns {Promise<void> & { cancel(): void }}
*/
export function RemoveAllPendingNotifications() {
let $resultPromise = /** @type {any} */($Call.ByID(1423986276));
return $resultPromise;
}

/**
* RemoveDeliveredNotification removes a specific delivered notification
* @param {string} identifier
* @returns {Promise<void> & { cancel(): void }}
*/
export function RemoveDeliveredNotification(identifier) {
let $resultPromise = /** @type {any} */($Call.ByID(149440045, identifier));
return $resultPromise;
}

/**
* RemovePendingNotification removes a specific pending notification
* @param {string} identifier
* @returns {Promise<void> & { cancel(): void }}
*/
export function RemovePendingNotification(identifier) {
let $resultPromise = /** @type {any} */($Call.ByID(3872412470, identifier));
return $resultPromise;
}

/**
* RequestUserNotificationAuthorization requests permission for notifications.
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function RequestUserNotificationAuthorization() {
let $resultPromise = /** @type {any} */($Call.ByID(3412125712));
return $resultPromise;
}

/**
* SendNotification sends a notification with the given identifier, title, subtitle, and body.
* @param {string} identifier
* @param {string} title
* @param {string} subtitle
* @param {string} body
* @returns {Promise<void> & { cancel(): void }}
*/
export function SendNotification(identifier, title, subtitle, body) {
let $resultPromise = /** @type {any} */($Call.ByID(2246903123, identifier, title, subtitle, body));
return $resultPromise;
}

/**
* SendNotificationWithActions sends a notification with the specified actions
* @param {$models.NotificationOptions} options
* @returns {Promise<void> & { cancel(): void }}
*/
export function SendNotificationWithActions(options) {
let $resultPromise = /** @type {any} */($Call.ByID(1615199806, options));
return $resultPromise;
}
Binary file not shown.
Loading