question

PrasanthKumar-9388 avatar image
0 Votes"
PrasanthKumar-9388 asked JarvanZhang-MSFT commented

Redirecting to Web URL from mobile app through Xamarin.Forms.Essential

I'm currently facing an issue with the mobile application. While clicking the "sign-up" button on our mobile app, usually it will redirect the user to the sign-up page via browser. But what happens now is that, when the sign-up button is clicked, the browser opens as usual but instead of loading the sign-up page, "login" page gets loaded on the browser. What is to be noted here is that the URL when redirected by the application is for the sign-up page. Whereas in-between, it automatically changes to the URL of the login page. I've checked the code thoroughly and it clearly has the URL of the sign-up page.

Angular is used for Web application.

dotnet-xamarin
· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, PrasanthKumar-9388. Do you use the Xamarin.Essentials.Browser api to perform the work in your project? I create a basic demo to test the function, it works fine. Try to add a breakpoint to debug to check the uri.

private async void Button_Clicked(object sender, EventArgs e)
{
    try
    {
        await Browser.OpenAsync(new Uri("xxx"), BrowserLaunchMode.SystemPreferred);
    }
    catch (Exception ex)
    {
        // An unexpected error occured. No browser may be installed on the device.
    }
}
0 Votes 0 ·

Yes, I am using Xamarin.Essentials.Browser API.

While debugging, it shows the correct URL. But after redirected to browser, it shows different URL.

For instance, i have given URL as https://XXXX.net/#/signup", but it redirects to the https://XXXX.net/#/login"

0 Votes 0 ·

Hi, try to load the signup url in a browser directly to check if it will work fine.

0 Votes 0 ·
Show more comments

0 Answers