Detect if Mobile Web App is within native Facebook App

二次信任 提交于 2019-12-04 14:24:12

问题


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:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!