我需要在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
);
});
答案 0 :(得分:1)
您可以使用任何基于fetch
/ XMLHttpRequest
的方法来访问Instant Games中的后端系统,但是(根据Facebook的开发人员政策)您不得使用第三方广告网络。受众群体网络是即时游戏唯一受支持的广告网络。
张四光的评论下面有更多详细信息,此处复制以供将来参考:
XMLHttpRequest
几乎可以遍及每个地方,不受FBInstant.player.getSignedPlayerInfoAsync
的限制