2

Recently (I believe some weeks ago) with the latest update of the Twitter app for iOS, all links found inside tweets are opened in Twitter's build-in browser. My question is how to find Twitter's browser agent so I can display custom messages.

For example: If browser is Twitter's in-app browser then display a custom message via HTML+PHP. It seems that there is no known agent available. Any help would be appreciate.

Martijn Pieters
  • 14,499
  • 10
  • 57
  • 58
Theodoros80
  • 137
  • 1
  • 5

3 Answers3

3

I tweeted to http://whatsmybrowser.org and then opened it up using the latest Twitter app on iOS as of 12/1/14. Here is my user agent:

http://www.whatsmybrowser.org/b/IQBX258

Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12B435

big lep
  • 131
  • 2
1

This seems to be very difficult to do, Ruadhán O'Donoghue did a thorough investigation on the subject in this blog post, testing for browser agents in iOS and Android, in Twitter and Facebook, and comparing them with the normal response. His conclusion is that Twitter does not identify itself.

Twitter does change every link on its platform: maybe it would be worthwhile to test for that instead.

ganar
  • 111
  • 1
0

Two obvious means for discovering a user agent come to mind. The first is checking your server logs. The user agent is typically logged by default, and you can add it if it's not.

The second method is to put http://whatsmyuseragent.com in a tweet and visit it from an iOS device to see what it says.

Karl Bielefeldt
  • 146,727
  • 38
  • 279
  • 479