-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add support for HTML5 Notification API #308
Comments
@dstaley - thanks for the feature request! This something we have in the works, I will return to this thread when we have more clarity on when this feature will be completed. |
This was 3 months ago. Any news on the issue? |
Still waiting |
Sorry for the delay! Would the PermissionRequested event work for you scenario? |
PermissionRequested not working at all, i implemented client from that tutorial: I'm using "Microsoft.Web.WebView2" version="0.9.579-prerelease" targetFramework="net472" Version 0.9.628-prerelease not work at all. |
Are you not getting the PermissionRequested event firing on the WebView? Can you link what part of that tutorial you are using for permission registration? |
Any updates or timeline? |
I don't know if this is important to this, but I can't get the permissionRequested even to fire using C# and WPF. It builds fine but doesn't run so I can't see what difference that makes. No errors are shown during runtime. |
Same here. The permissonRequested never fires.
…Sent from my iPad
On Mar 10, 2021, at 8:42 PM, Wyatt Jackson ***@***.***> wrote:
I don't know if this is important to this, but I can't get the permissionRequested even to fire using C# and WPF. It builds fine but doesn't run so I can't see what difference that makes. No errors are shown during runtime.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
If I understand correctly, you basically removed this feature with version 0.8.314 https://docs.microsoft.com/en-us/microsoft-edge/webview2/release-notes#08314
This issue is now close to its 1-year anniversary. Are there any updates? |
Anyone getting this to work? I've tried
But when I try to run my app, it throws an exception: Object reference not set to an instance of an object. |
Nope. The PermissionRequested event does not fire in .net. Works on Win32. Waiting for bug to be addressed.
…Sent from my iPhone
On Jun 20, 2021, at 5:47 PM, DogFoxX ***@***.***> wrote:
Anyone getting this to work? I've tried
`webView21.CoreWebView2.PermissionRequested += CoreWebView2_PermissionRequested;
private void CoreWebView2_PermissionRequested(object sender, Microsoft.Web.WebView2.Core.CoreWebView2PermissionRequestedEventArgs e)
{
e.State = CoreWebView2PermissionState.Allow;
}`
But when I try to run my app, it throws an exception: Object reference not set to an instance of an object.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Got it working with this code I got from another issue, can't seem to find it again though:
The event seems to fire now for any Permission Request, all except for notifications. As stated in die Documentation, Notifications are auto-rejected and no event is raised for it.
It's a shame this hasn't been addressed yet. |
Also waiting on this feature; any timeline on this? A timeline would be helpful because it would help inform whether or not to implement a custom work around. Thanks |
We don't currently have this work scheduled within the next quarter. |
This would also be very useful for us since currently we are using a service worker to support push notifications in our PWA. Also not sure what would be the best custom workaround here for a WinUI3.0 app? Using the push notifications API as being used by UWP apps? (Not sure that API is available for desktop apps). Or is there another alternative that we could use? |
Just wondering if this still is on the radar @champnic ? Would still be awesome to have this supported ... |
It's on the radar. It's not scheduled for this quarter, but if it's priority on our backlog doesn't change, then I think we would begin work next quarter. The current workaround is indeed to use the existing Windows Notifications APIs from the host app. |
@OkkioXavier - what do you mean by that? do you mind expanding on your app scenario that requires notifications? Are you talking about push/background notifications through WNS? Most of the stuff I've outlined is to get e2e support for HTML5 Notifications API. |
@jasonstephen15 thanks for your reply. Some more details: We're implementing a line of business application which is deployed to enterprise users, it's important for our use case that user permission is not required for push notifications. The application which we are replacing is built in WinForms and uses the NotifyIcon class to display notifications to users. User interaction is not required to display a NotifyIcon. WebView2 already implements support for the PermissionRequested event for other HTML5 functionality such as ClipboardRead. For those events you can programmatically grant/deny permission. When permission is granted programmatically no permissions dialog is displayed to the user. Above I was asking that the existing pattern is applied to the PermissionRequested event when raised for push notifications. Sample code for ClipboardRead:
Thanks! Let me know if you need any further details |
Just sharing our use case @jasonstephen15 as well. We're currently working on a WinUI3.0 desktop app embedding a Webview2 control. The web app loaded in Webview2 will register a service worker which allows to receive push messages through the Push API. So what would be very nice to have:
All the other points you made are very valuable as well. And also in favour of being able to enable notifications without user interaction as @OkkioXavier proposed. |
@OkkioXavier - right, in earlier message I noted |
@jasonstephen15 Yep, exactly. I was just clarifying that when the event fires we want the existing permissions grant functionality to be maintained. Thanks for following up. |
This sounds like it is planned, that Edge/WebView itself will create the toast notifications showed to the user. Is this optional? For our use case it would be important, that the WebView is providing the HTML5 Notifications payload to the app without showing any notification. Instead, we want to process the payload with our app code. And after, the toast notification would then be created by the app itself. |
if the event allowed updating the payload and the option to set a Handled property like keypress events do that would tell the webview to not show the notification, that would be amazing. |
Looks like's it been a few months since the last update, is this still on the roadmap? I also have an enterprise application this would be key to. I'd need to be able to programmatically allow the push and then handle notifications to the user in my code, since it will be primary operating on devices that use a custom shell, which doesn't support native windows notifications. |
I believe we have begun work on this feature - @peiche-jessica should have the latest. |
Hello, Is there any updates regarding this feature ? |
It should be available in the next SDK release in early June. Thanks. |
Hello! @peiche-jessica would love to use this. Let me know if it's in a release yet. |
just writing once more, let me know if it was released |
Hi @amilich It's released as experimental API now: please check out https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes?tabs=dotnetcsharp#experimental-features |
Amazing! |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Still not working with 1.0.1988-prerelease and 1.0.1901 release. "DOMException: Registration failed - push service error." My push subscription code in PWA works well with Chrome and Edge, but it doesn't work with webview2. |
@ddart2 What runtime version are you using? You'll likely need to use Edge Canary/Dev for this to work: |
I am using and setting environment with 118.0.2048.1 dev. |
Anyone still with this issue? It works for Edge v 118, but not for WebView2 |
Still now, it is not fired. |
In WinUI3 WebNotifcations are still not available. |
It would be really nice if WebView2 had appropriate APIs to handle granting notification permissions and displaying notifications from web content that uses the standard Notifications API.
AB#27693296
The text was updated successfully, but these errors were encountered: