简体   繁体   English

FBInstant.player.getConnectedPlayersAsync() 总是返回空

[英]FBInstant.player.getConnectedPlayersAsync() always returns empty

my code is:我的代码是:

let global_config = {

};
window.onload = function (e) {
  FBInstant.initializeAsync()
    .then(function () {
      FBInstant.startGameAsync()
        .then(function () {
          var contextId = FBInstant.context.getID();
          var contextType = FBInstant.context.getType();

          var playerName = FBInstant.player.getName();
          var playerPic = FBInstant.player.getPhoto();
          var playerId = FBInstant.player.getID();

          global_config["contextId"] = contextId;
          global_config["contextType"] = contextType;
          global_config["playerName"] = playerName;
          global_config["playerPic"] = playerPic;
          global_config["playerId"] = playerId;

          console.log("default", global_config);

          FBInstant.player.getConnectedPlayersAsync()
            .then(function (players) {
              console.log("getConnectedPlayersAsync", players);
            }).catch(err => {
              console.error("getConnectedPlayersAsync", err);
            });
        });
  });
}

The game is currently in development mode.该游戏目前处于开发模式。 I invited a few friends to test.我邀请了几个朋友来测试。 The friends have authorized the game, but calling FBInstant.player.getConnectedPlayersAsync() api keeps returning empty.小伙伴授权了游戏,但是调用FBInstant.player.getConnectedPlayersAsync() api 一直返回空。

I want to know where is the problem and how to solve it我想知道问题出在哪里以及如何解决

Found the reason, user_friends permissions need to be audited找到原因了,需要审核user_friends权限

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

相关问题 在Facebook即时游戏中如何以及在哪里使用FBInstant.updateAsync - How and where to use FBInstant.updateAsync in facebook instant game 出现FBInstant广告“ NO FILL”错误时该怎么办 - What should I do when FBInstant ad “NO FILL” error shows FBInstant未定义 - FBInstant is not defined FBInstant.shareAsync()函数在facebook即时游戏“共享”按钮中没有任何错误将不起作用 - FBInstant.shareAsync() function doesn't work without any errors in facebook instant game Share button Facebook Instant Gaming对接会在“该玩家当前不符合比赛条件”上被封锁。 - Facebook Instant Gaming Matchmaking blocked on “The player is not currently eligible to match.” 如何在浏览器中测试FBInstant.payments? - how to test FBInstant.payments in browser? FBInstant.updateAsync() 解析成功但什么都不做 - FBInstant.updateAsync() resolves successfully but do nothing 如何在服务器端验证 FBInstant.context.getID() 以确保它不是伪造的? - How to verify FBInstant.context.getID() on the server side to ensure it is not faked? 为什么FBInstant.chooseAsync方法没有将游戏请求发送给朋友? - Why FBInstant.chooseAsync method not sending game play request to friend? 有没有其他方法可以在 FBInstant.updateAsync 中插入图像 - Is there any other way to insert image in FBInstant.updateAsync
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM