简体   繁体   English

Facebook分享计数器无法在iOS上使用

[英]Facebook share counter not working on iOS

I have facebook share counter on my website and it works correct,but on iOS Safari it doesn't show show number of shares. 我的网站上有Facebook分享计数器,它可以正常运行,但是在iOS Safari上,它没有显示分享数量。 If I'm using incognito mode (private), it works correctly... Any suggestions? 如果我使用隐身模式(私有),则可以正常使用...有什么建议吗?

 $.getJSON( 'http://graph.facebook.com/?id=http://example.com', function( fbdata ) {
      $('#fb-count').text(fbdata.share.share_count)
 });

Even if I'll use simple alert() inside function it won't appear... 即使我在函数中使用简单的alert() ,它也不会出现...

Ok, found a solution using PHP. 好的,找到了使用PHP的解决方案。

$fb = json_decode( file_get_contents('https://graph.facebook.com/http://example.com') );
$shares = $fb->share->share_count;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM