0

how to identify requests which are originating from Mobile App (Mobile application) and which are originating from the Mobile Browser (Any) ???

Lets say facebook can be accessed by facebook-app or it can be accessed through the web-browser. how can we identify the incoming request in the server side which are from facebook app and which are accessed from web-browser.

  • possible duplicate http://stackoverflow.com/questions/11381673/detecting-a-mobile-browser – Farside Mar 04 '16 at 23:59
  • the question is useless, and there are tons of answers here on stackoverflow, depending on the coding language and other preferences. The concept of detection is the same everywhere. Please, use search, before shooting questions. – Farside Mar 05 '16 at 00:01
  • So, am I right? You want to differentiate on server side between requests from mobile browsers and APPs? May be you could clarify your question... – theafh Mar 05 '16 at 15:16

1 Answers1

0

Requests from Facebook in ordinary browsers could be identified for example if a corresponding referrer is set with the Domain facebook.com. The internal browser of the Facebook-APP could be identified by user agent tokens containing (some) strings like this in square brackets:

[FBAN FBIOS FBAV FBMD FBSN FBSV FBSS FBCR FBID FBLC FBOP FB_IAB FB4A]

This would be an example user agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12B440 [FBAN/FBIOS;FBAV/44.0.0.54.111;FBBV/17684769;FBDV/iPhone7,2;FBMD/iPhone;FBSN/iPhone OS;FBSV/8.1.2;FBSS/2; FBCR/T-MobileA;FBID/phone;FBLC/de_DE;FBOP/5]

You could find thousands of real live examples in this user agent search engine...

theafh
  • 478
  • 2
  • 7
  • thanks a lot for responding theafh. and it is helpful. analyzed the data based on the input you provided. here I took the facebook as an example just to make the question clear. I need in general, what is the thumb rule to identify the usage is from the App (any app like, twitter, google+.... etc) or from the browser... because the "TwitterAndroid/5.97.0 (5110035-r-848) Nexus 6/6.0.1 (motorola;Nexus 6;google;shamu;0;;0)" this is the user agent for the twitter. it does not contains any of the strings you provided. – Manjunath Prasad Mar 05 '16 at 01:00
  • OK, sorry then I misunderstood your question. Yes you could detect some APPs on request via some tokens in the user agent. Unfortunately this is app specific, as in my answer on the Facebook sample. – theafh Mar 05 '16 at 10:04