簡體   English   中英

Facebook Instant Game是否僅支持getSignedPlayerInfoAsync與游戲后端進行通信?

[英]Does Facebook Instant Game only support getSignedPlayerInfoAsync for communication with game backend?

我需要在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
    );
   });

您可以使用任何基於fetch / XMLHttpRequest的方法來訪問Instant Games中的后端系統,但是(根據Facebook的開發人員政策)您不能使用第三方廣告網絡。 受眾群體網絡是即時游戲唯一受支持的廣告網絡。

張思光的評論在下面有更多詳細信息,此處復制以備將來參考:

  1. Web端必須支持https;
  2. Web端必須支持CORS跨域(html5rocks.com/en/tutorials/cors);
  3. XMLHttpRequest可以在幾乎每個地方進行請求,不受FBInstant.player.getSignedPlayerInfoAsync限制

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM