Xamarin forms open browser and get Response data

previousversiondocs 51 Reputation points
2021-10-14T17:46:24.317+00:00

I want to open a website in my app to make the user log in to a specific page (so he can trust that it's the real website), if the login succeeds, there is data in the response which I need for my application. Is there a way to get the response data from the xamarin webview or browser or something else?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,296 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,451 Reputation points Microsoft Vendor
    2021-10-15T06:33:24.357+00:00

    Hello,
    Welcome to our Microsoft Q&A platform!

    As you said “open a website in my app to make the user log in to a specific page”, I recommend you to use Xamarin.Essentials: Web Authenticator,this often means enabling your users to sign in their existing Microsoft, Facebook, Google, and now Apple Sign In accounts.

    If you want to get the return value of web, invoking a JavaScript function in C # may be a good choice. It need to be handled in Javascript code on the web page side, this requires you know about Javascript. For more infor information, you can refer to
    https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows#invoking-javascript

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments