Facebook FB.Event.subscribe没有在手机版上开火 [英] facebook FB.Event.subscribe is not firing on mobile version

查看:98
本文介绍了Facebook FB.Event.subscribe没有在手机版上开火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当广告创建评论时,我正在尝试创建一个小的通知程序。它在桌面版本上完美无缺,但在移动版本上, FB.Event.subscribe 未触发。

I am trying create a small notifier thingy when a comment have been created for an advert. It works flawlessly on the desktop version, but on the mobile version the FB.Event.subscribe is not fired.

我有这个代码:

    <script>

         window.fbAsyncInit = function() {

        // init the FB JS SDK
        FB.init({
          appId      : 'XXXX'
          channelUrl : 'http://www.xxx.dk/channel.php',
          status     : true,
          xfbml      : true
        });


        FB.Event.subscribe('comment.create',
           function (response) {
              $.ajax({
                  url: 'http://www.xxx.dk/notify.php',
                  type: 'POST',
                  data: { aid: {$viewad.aid} },
                  success: function(data) { },
                  error: function(data) { }
                });
            });
      };  

      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
 </script>

两个fbAsyncInit和FB.init正在被正常启动!如果我提醒(被解雇),我会得到该警报,但不在FB.Event.subscribe内。

both fbAsyncInit and FB.init is being fired correctly! If I put in alert("fired") I will get that alert, but not inside FB.Event.subscribe

channel.php包含以下内容:

channel.php contain this:

<?php
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
?>
<script src="//connect.facebook.net/en_US/all.js"></script>


推荐答案

这是插件中的错误

https://developers.facebook.com/bugs/604681079553717

Damn .. FB的修复速度很慢!

Damn.. FB are slow on fixing!

这篇关于Facebook FB.Event.subscribe没有在手机版上开火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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