Facebook即时游戏“邀请社交游戏”未出现

时间:2018-07-31 20:22:00

标签: html5 facebook facebook-instant-games

玩家死亡时,我们会触发此代码,但不会在受挑战的朋友的信使箱中张贴消息。

      try{
        var playerName = FBInstant.player.getName();
        FBInstant.updateAsync({
          action: 'CUSTOM',
          cta: 'Play',
          image: base64Picture,
          text: {
            default: playerName + ' ate ' + gameScore + ' fish in SeaFrenzy!',
            localizations: {
                en_US: playerName + ' ate ' + gameScore + ' fish in SeaFrenzy!',
                pt_BR: playerName + ' ate ' + gameScore + ' fish in SeaFrenzy!',
            }
          },
          template: 'SeaFrenzy Eats',
          data: { myReplayData: '...' },
               strategy: 'IMMEDIATE',
               notification: 'NO_PUSH',
               }).then(function() {
                   console.log('Message was sent successfully');
        });
      }
      catch(err) {
        console.log('FBInstant Games Error: Player Death and score: Internet Not Connected.');
      }

0 个答案:

没有答案