Brad Dwyer
Brad Dwyer

Reputation: 6504

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?

Upvotes: 2

Views: 1055

Answers (1)

Brad Dwyer
Brad Dwyer

Reputation: 6504

Found the answer here. Use this code:

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

Upvotes: 1

Related Questions