1

我需要在Facebook即时游戏中展示广告,我所属的公司希望adID通过与游戏服务器的通信来满足试听。从 Facebook 链接(https://developers.facebook.com/docs/games/instant-games/guides/bots-and-server-communication#backend),游戏只能像下面这样工作:

FBInstant.player.getSignedPlayerInfoAsync('custom_payload_supplied_with_request')
  .then(function (result) {
    // The verification of the ID and signature should happen on server side.
    SendToMyServer(
      result.getPlayerID(), // same value as FBInstant.player.getID()
      result.getSignature(),
      ... //any additional parameters required for your server call
    );
   });
4

1 回答 1

1

您可以在 Instant Games 中使用任何fetch/XMLHttpRequest基于方法访问您的后端系统,但您不得(根据 Facebook 的开发者政策)使用第三方广告网络。Audience Network 是小游戏唯一受支持的广告网络。

下面张四光的评论有更多细节,这里复制以备将来参考:

  1. web端必须支持https;
  2. web端必须支持CORS跨域(html5rocks.com/en/tutorials/cors);
  3. XMLHttpRequest几乎可以通过每个地方请求,不受限制FBInstant.player.getSignedPlayerInfoAsync
于 2018-08-07T21:05:25.250 回答