3

Is it somehow possible to detect Facebook's mobiles apps' browser via PHP or JS? My apps all have problems inside their browser (in native browser not!) and I want to show a warning notice.

Alternatively, is there a possibility to directly open the website in a external browser?

  • 1
    Detecting it by evaluating the `User-Agent` header is probably your best bet. http://stackoverflow.com/questions/11414006/is-this-a-facebook-for-ios-webview-user-agent – CBroe Jul 09 '15 at 12:58

1 Answers1

1

This works fine for me in JavaScript:

if (navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/FBAV/i)) {
    //iOS Facebook App Browser detected
}

More information about the User Agent: Is this a Facebook for iOS WebView User Agent?

Afaik it´s not possible to force the website to open in any external browser, only the user can do that.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130