-
Notifications
You must be signed in to change notification settings - Fork 55
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
API Review: Web Notification #3186
base: main
Are you sure you want to change the base?
Changes from 1 commit
1c1d3d0
952a757
e03a214
cbd9d61
5e22e5f
0b9a618
61d7ae7
c61f653
b8395cb
88418d0
0b6a3aa
25207b4
8ef88d3
4908aaf
993fe9f
320baf0
16ba2bc
4493c00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,6 +438,18 @@ interface ICoreWebView2UnsignedLongCollection : IUnknown { | |
HRESULT GetValueAtIndex([in] UINT index, [out, retval] UINT64* value); | ||
} | ||
|
||
/// The caller implements this interface to receive the result of reporting a notification clicked. | ||
[uuid(1013C0D5-5F0C-4BF8-BA52-9D76AFA20E83), object, pointer_default(unique)] | ||
interface ICoreWebView2NotificationReportClickedCompletedHandler : IUnknown { | ||
HRESULT Invoke([in] HRESULT errorCode); | ||
} | ||
|
||
/// The caller implements this interface to receive the result of reporting a notification closed. | ||
[uuid(D8B63F74-1D78-4B4C-ACA9-7CB63FDFD74C), object, pointer_default(unique)] | ||
interface ICoreWebView2NotificationReportClosedCompletedHandler : IUnknown { | ||
HRESULT Invoke([in] HRESULT errorCode); | ||
} | ||
|
||
/// This is the ICoreWebView2Notification that represents a [HTML Notification | ||
/// object](https://developer.mozilla.org/docs/Web/API/Notification). | ||
[uuid(E3F43572-2930-42EB-BD90-CAC16DE6D942), object, pointer_default(unique)] | ||
|
@@ -470,7 +482,7 @@ interface ICoreWebView2Notification : IUnknown { | |
/// You should only run this if you are handling the `NotificationReceived` | ||
/// event. Returns `E_ABORT` if `Handled` is `FALSE` or `ReportShown` has not | ||
/// been run when this is called. | ||
HRESULT ReportClicked(); | ||
HRESULT ReportClicked([in] ICoreWebView2NotificationReportClickedCompletedHandler* handler); | ||
|
||
/// The host may run this to report the persistent notification has been | ||
/// activated with a given action, and it will cause the | ||
|
@@ -481,7 +493,7 @@ interface ICoreWebView2Notification : IUnknown { | |
/// is `FALSE` or `ReportShown` has not been run when this is called. Returns | ||
/// `E_INVALIDARG` if an invalid action index is provided. Use `ReportClicked` | ||
/// to activate an non-persistent notification. | ||
HRESULT ReportClickedWithAction([in] UINT actionIndex); | ||
HRESULT ReportClickedWithAction([in] UINT actionIndex, [in] ICoreWebView2NotificationReportClickedCompletedHandler* handler); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "WithActionIndex"? Because you don't pass the Action itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an arity-overload in the C# but different method name here. Intentional discrepancy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes due to COM IDL limitations. |
||
|
||
/// The host may run this to report the notification was dismissed, and it | ||
/// will cause the | ||
|
@@ -491,7 +503,7 @@ interface ICoreWebView2Notification : IUnknown { | |
/// event for persistent notifications. You should only run this if you are | ||
/// handling the `NotificationReceived` event. Returns `E_ABORT` if `Handled` | ||
/// is `FALSE` or `ReportShown` has not been run when this is called. | ||
HRESULT ReportClosed(); | ||
HRESULT ReportClosed([in] ICoreWebView2NotificationReportClosedCompletedHandler* handler); | ||
|
||
/// A string representing the body text of the notification. | ||
/// The default value is an empty string. | ||
|
@@ -703,9 +715,9 @@ namespace Microsoft.Web.WebView2.Core | |
event Windows.Foundation.TypedEventHandler<CoreWebView2Notification, Object> CloseRequested; | ||
|
||
void ReportShown(); | ||
void ReportClicked(); | ||
void ReportClicked(UInt32 actionIndex); | ||
void ReportClosed(); | ||
Windows.Foundation.IAsyncAction ReportClickedAsync(); | ||
Windows.Foundation.IAsyncAction ReportClickedAsync(UInt32 actionIndex); | ||
Windows.Foundation.IAsyncAction ReportClosedAsync(); | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no sample showing "with an action" vs ReportClicked. Does no-action mean customer clicked the notification body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add another sample that does persistent notifications and uses ReportClickedWithAction