Detect if Mobile Web App is within native Facebook

2019-03-22 04:49发布

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?

1条回答
Animai°情兽
2楼-- · 2019-03-22 05:50

Found the answer here. Use this code:

if (FB.UA.nativeApp()) {
  // Hide your credits stuff
}
查看更多
登录 后发表回答