You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone!
I want display the website to winforms application (in windows 10) through webview2, and have a look at the sample here.
But in my web, push notification permission is required, so is it possible to show a popup requesting permission like on the website? or is it possible to handle the event when permission is requested?
This is my code javascript on website
function requestPermission() {
console.log('Requesting permission...');
Notification.requestPermission().then((permission) => {
if (permission === 'granted') {
console.log('Notification permission granted.');
} else {
console.log('Unable to get permission to notify.');
}
});
}
And error: An error occurred while retrieving token. FirebaseError: Messaging: The notification permission was not granted and blocked instead. (messaging/permission-blocked).
On Jun 2, 2021, at 9:16 PM, wdvqmj7377 ***@***.***> wrote:
Hi everyone!
I want display the website to winforms application (in windows 10) through webview2, and have a look at the sample here.
But in my web, push notification permission is required, so is it possible to show a popup requesting permission like on the website? or is it possible to handle the event when permission is requested?
This is my code javascript on website
function requestPermission() {
console.log('Requesting permission...');
Notification.requestPermission().then((permission) => {
if (permission === 'granted') {
console.log('Notification permission granted.');
} else {
console.log('Unable to get permission to notify.');
}
});
}
And error: An error occurred while retrieving token. FirebaseError: Messaging: The notification permission was not granted and blocked instead. (messaging/permission-blocked).
I searched and found CoreWebView2.PermissionRequested Event but when I implement it can't raised.
public Form1()
{
InitializeComponent();
Init();
webView21.CoreWebView2.PermissionRequested += CoreWebView2_PermissionRequested;
}
private void CoreWebView2_PermissionRequested(object sender, Microsoft.Web.WebView2.Core.CoreWebView2PermissionRequestedEventArgs e)
{
System.Console.WriteLine("Hello!!!");
}
Thank you very much
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Hi everyone!
I want display the website to winforms application (in windows 10) through webview2, and have a look at the sample here.
But in my web, push notification permission is required, so is it possible to show a popup requesting permission like on the website? or is it possible to handle the event when permission is requested?
This is my code javascript on website
And error:
An error occurred while retrieving token. FirebaseError: Messaging: The notification permission was not granted and blocked instead. (messaging/permission-blocked).
I searched and found CoreWebView2.PermissionRequested Event but when I implement it can't raised.
Thank you very much
The text was updated successfully, but these errors were encountered: