检测Mobile Web App是否在本机Facebook App中 [英] Detect if Mobile Web App is within native Facebook App

查看:98
本文介绍了检测Mobile Web App是否在本机Facebook App中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以检测我们的移动Web应用程序是否显示在本机Facebook iOS应用程序的WebView中或是否独立运行?

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?

据我们了解,我们不允许在其框架内获得Facebook积分,但我们 可以在我们自己的独立Web应用程序(或通过Safari)中接受它们.

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?

推荐答案

此处.使用此代码:

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

这篇关于检测Mobile Web App是否在本机Facebook App中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆