这不是 native 解决方案,只是响应式网站。问题是,FB.login 根本不执行任何操作。 FB.ui 方法也是如此。
我在 head 中调用 fb init(但也在 body 中尝试了同样的结果......)像这样:
<script type="text/javascript">
FB.init({
appId: '{$app_id}',
status: true,
cookie: true,
xfbml: true,
channelUrl: 'https://www.nottyfly.com/channel.php',
oauth: true
});
当用户点击fb登录按钮时,代码如下:
function fbLogin(){
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me/permissions', function (response) {
var perms = response.data[0];
document.getElementById("accesstoken").value=FB.getAuthResponse()['accessToken'];
document.getElementById("korak1").submit();
} );
} else {
alert('{$alert_confirm_app}');
}
}, {scope:'email'});
}
这一切在网页上运行良好,但在移动浏览器上却一事无成?
附言。这是演示 web page
最佳答案
这是移动浏览器中的常见问题,您会发现它也会出现在某些 Android 设备中。
为预防起见,最佳做法是手动构建登录流程。去这里https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
是的,您将需要进行手动集成。但是,毫无疑问,这将是完全验证的集成。
关于facebook - FB.login 在移动浏览器中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31248610/