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?
Found the answer here. Use this code:
if (FB.UA.nativeApp()) {
// Hide your credits stuff
}
来源:https://stackoverflow.com/questions/10627509/detect-if-mobile-web-app-is-within-native-facebook-app