0

I have two issues in my UWP app with a WebView Control accessing WhatsApp Web. For these two issues I have searched the web for answers, without any luck.

Issue no1. I have set the WebNotifications to Allow with the following:

private void WebView_PermissionRequested(WebView sender, WebViewPermissionRequestedEventArgs args)
{
  if (args.PermissionRequest.PermissionType == WebViewPermissionType.WebNotifications)
   {
    args.PermissionRequest.Allow();
   }
}

My problem is, that each time I restart my app it asks for the permission again. How do I store the permission to never ask again?

Issue no2. In WhatsApp Web there is an option on any shared file (photo, pdf, etc) to Download it. Problem is when I click on Download, nothing happens. Are there any settings for WebView to allow downloads, or open Download/Save As Dialog?

halfer
  • 19,824
  • 17
  • 99
  • 186
DogFoxX
  • 111
  • 10
  • It seems we can not store the permission, everytime we restart the app, we still need to allow the requested permission. In addition, there is no setting for webview to allow downloads, webView can not download file. – Faywang - MSFT Aug 17 '20 at 06:25
  • That is quite a shame, because I've switched to UWP with WebView from a WinForms App with EO.WebBrowser. EO worked fine, but was so slow, and didn't allow Push Notifications. I have to say, working with UWP is so mush easier. I would like to use WebView2 in the future, but there are so many limitations at the moment. Are there any other Browsers I can use to embed, like based on Chromium that allows notifications, as well as proprietary media? – DogFoxX Aug 17 '20 at 11:04
  • I got my solution for allowing the permissions in this [link](https://stackoverflow.com/questions/57479245/how-to-add-support-for-html5-notifications-in-xaml-webview-in-a-uwp-app). The last comment by @daljit97 he says that the problem with saving the permission **can easily be solved**. What does he mean by this? – DogFoxX Aug 17 '20 at 11:54
  • Currently you could not embed Browsers like Chromium into webview. – Faywang - MSFT Aug 18 '20 at 08:10
  • Are WebNotifications active on WebView2? And would WebView2 solve my problem with the saving of permissions? – DogFoxX Aug 20 '20 at 13:07
  • Currently WebView2 is still in preview, if you have a need for this feature, you could ask it on [Github](https://github.com/microsoft/microsoft-ui-xaml/issues). – Faywang - MSFT Aug 21 '20 at 06:14

0 Answers0