Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook共享计数器在iOS上不工作_Ios_Facebook Graph Api - Fatal编程技术网

Facebook共享计数器在iOS上不工作

Facebook共享计数器在iOS上不工作,ios,facebook-graph-api,Ios,Facebook Graph Api,我的网站上有facebook共享计数器,它工作正常,但在iOS Safari上它没有显示共享数量。如果我使用隐姓埋名模式(私人),它可以正常工作。。。有什么建议吗 $.getJSON( 'http://graph.facebook.com/?id=http://example.com', function( fbdata ) { $('#fb-count').text(fbdata.share.share_count) }); 即使我在函数中使用simplealert()它也不

我的网站上有facebook共享计数器,它工作正常,但在iOS Safari上它没有显示共享数量。如果我使用隐姓埋名模式(私人),它可以正常工作。。。有什么建议吗

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

即使我在函数中使用simple
alert()
它也不会出现…

好的,找到了使用PHP的解决方案

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