facebookweb-applicationsmobilefacebook-credits

Detect if Mobile Web App is within native Facebook App


Is there a way to detect if our Mobile Web App is being displayed inside a WebView in the native Facebook iOS app or if it is running standalone?

As we understand it, we are not allowed to take Facebook credits from within their frame but we are allowed to accept them from within our own standalone Web App (or via Safari).

But how can we detect whether or not we can accept credits in the current state?


Solution

  • Found the answer here. Use this code:

    if (FB.UA.nativeApp()) {
      // Hide your credits stuff
    }