title: Xamarin - Requesting camera permissions in WebView
body: <p>I want to make a container-app for my web application, and I decided to do so in Xamarin because the rest of the project is also .NET.</p>
  
  <p>Initially I downloaded and setup the project from Xamarin Sample Pages:
  <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows" rel="noreferrer">https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows</a></p>
  
  <p>I simply changed a few variables in WebPage.cs: <a href="https://github.com/xamarin/xamarin-forms-samples/blob/master/WorkingWithWebview/WorkingWithWebview/WebPage.cs" rel="noreferrer">https://github.com/xamarin/xamarin-forms-samples/blob/master/WorkingWithWebview/WorkingWithWebview/WebPage.cs</a></p>
  
  <pre><code>using Xamarin.Forms;
  
  namespace WorkingWithWebview
  {
      public class WebPage : ContentPage
      {
          public WebPage()
          {
              var browser = new WebView();
              browser.Source = "https://xamarin.swappsdev.net";
              Content = browser;
          }
      }
  }
  </code></pre>
  
  <p>Secondly I updated App.cs to suit my needs: <a href="https://github.com/xamarin/xamarin-forms-samples/blob/master/WorkingWithWebview/WorkingWithWebview/App" rel="noreferrer">https://github.com/xamarin/xamarin-forms-samples/blob/master/WorkingWithWebview/WorkingWithWebview/App</a>.</p>
  
  <pre><code>using Xamarin.Forms;
  
  namespace WorkingWithWebview
  {
      public class App : Application
      {
          public App ()
          {
              MainPage = new WebPage();
          }
      }
  }
  </code></pre>
  
  <p>And boom! I had an app.</p>
  
  <p>Then came the real struggle. In the web application I can – when opening the site (<a href="https://xamarin.swappsdev.net" rel="noreferrer">https://xamarin.swappsdev.net</a>) in the browser – click on a button which requests permissions from the device and then display the camera feed in the same window.</p>
  
  <p>When doing the same action in the app nothing happens.</p>
  
  <p>I then started googling for an answer and really didn’t find a lot. And the answers I found seems to be of an older version of Xamarin (?), since I wasn’t able to compare the files and structure in the answer compared to the one of the Xamarin Sample Page.
  <a href="https://stackoverflow.com/a/50560855">https://stackoverflow.com/a/50560855</a></p>
  
  <p>I tried implementing the answer from Robbit here. After a long struggle I managed to compile it and install it on my device but it doesn't actually ask for permissions.</p>
  
  <p>I am at a loss and could need some help/guidance.</p>