Bug 59101 - IOSPlatformServices.OpenUriAction fails to send querystrings with encoded characters
Summary: IOSPlatformServices.OpenUriAction fails to send querystrings with encoded cha...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.4.0
Hardware: PC Windows
: High critical
Target Milestone: 2.4.0
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2017-08-29 20:39 UTC by brett.lefebvre
Modified: 2017-09-01 15:31 UTC (History)
5 users (show)

Tags: ac ios OpenUri uri parameters, fr
Is this bug a regression?: Yes
Last known good build: 2.3.4.267


Attachments
repro project (55.87 KB, application/zip)
2017-08-29 22:51 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description brett.lefebvre 2017-08-29 20:39:59 UTC
In IOSPlatformServices.OpenUriAction Uri.ToString is being called which returns a very strange usually incorrect human readable url which then NSUrl.FromString cannot correctly parse and returns null.

You can try to open "http://test.com/?data=%7B%22Customer%22%3A%7B%22FirstName%22%3Anull%2C%22LastName%22%3Anull%2C%22Email%22%3Anull%7D%2C%22Description%22%3Anull%7D" which is url encoded json. The link will open but the entire querystring will be gone.

This PR broke it: https://github.com/xamarin/Xamarin.Forms/pull/734
Comment 1 Jimmy [MSFT] 2017-08-29 22:51:07 UTC
Created attachment 24463 [details]
repro project

### Overview
The parameters in a URI are being stripped out when using Device.OpenUri() on iOS.


### Affected Platforms
iOS


### Steps to Reproduce
1. Run the attached repro project
2. Click on "With encoded Params"


### Expected Results
The web browser will open to the Bing search results page


### Actual Results
The web browser opens the Bing homepage because the search parameters were removed


### Version Test
2.4.0-pre2  BAD
2.3.4.267   GOOD
Comment 2 Philipp Sumi 2017-08-30 07:25:49 UTC
Also try custom protocols - I recall getting weirdly formatted URIs using Uber's scheme, where an additional slash was inserted right after the protocal after parsing (so I ended up with uber:///?xxx). Here's a URI:

uber://?client_id=foobar&action=setPickup&pickup[latitude]=37.775818&pickup[longitude]=-122.418028&pickup[nickname]=UberHQ&pickup[formatted_address]=1455%20Market%20St%2C%20San%20Francisco%2C%20CA%2094103
Comment 4 Rui Marinho 2017-09-01 15:31:44 UTC
Should be fixed on 2.4.0-pre3