Twitter links clicked in Twitter iOS app add extraneous URL-encoded link to Tweet

ios

#1

Repro steps:

  1. Go to the following Tweet inside the Twitter app: https://twitter.com/AirbnbHelp/status/691485867458830336
  2. Click on the Twitter share icon.
  3. Noticed how the Tweet dialog in the app has the following content: “Airbnb Disaster Response https://www.airbnb.com/disaster-response https%3A%2F%2Fwww.airbnb.com%2Fdisaster-response”

If instead you go to https://www.airbnb.com/disaster-response and click the Twitter icon, it has the correct content: “Airbnb Disaster Response https://www.airbnb.com/disaster-response


#2

You probably want to remove the URL from the text query parameter component when constructing a Tweet web intent URL and encode parameters according to RFC 3986 (%20 vs +).

text=Airbnb+Disaster+Response+https%3A%2F%2Fwww.airbnb.com%2Fdisaster-response
&url=https%253A%252F%252Fwww.airbnb.com%252Fdisaster-response
&related=airbnb

The url query parameter fills a share text component. The text component is pre-selected in web browsers for easy editing before sharing; the URL parameter is placed separately.


#3