简体   繁体   English

Facebook Instant Games - 无需上传捆绑包的测试

[英]Facebook Instant Games - Testing without bundle uploading

Is it possibile to test a Facebook Instant Game without uploading the bundle on FB servers?是否可以在不将捆绑包上传到 FB 服务器的情况下测试 Facebook 即时游戏?

I'm using this code:我正在使用这段代码:

<body>
    <script src="https://connect.facebook.net/en_US/fbinstant.6.3.js"></script>

    <script>
    window.addEventListener('DOMContentLoaded', function() {

        FBInstant.initializeAsync().then(function() {

            console.log("FBInstant init ok!");

        });

    });
    </script>
</body>

The DOM is correctly loaded, but nothing is logged. DOM 已正确加载,但没有记录任何内容。

If I run initializeAsync() from console I get a 0/null variable:如果我从控制台运行 initializeAsync(),我会得到一个 0/null 变量:

> FBInstant.initializeAsync()
m {_state: 0, _value: null, _deferreds: Array(0)}

Yes, it's absolutely possible.是的,这是绝对可能的。 First, make sure you follow this guidelines https://developers.facebook.com/docs/games/instant-games/test-publish-share/首先,确保您遵循此指南https://developers.facebook.com/docs/games/instant-games/test-publish-share/

In test mode, FB opens the game in an iframe.在测试模式下,FB 在 iframe 中打开游戏。

Let me know if you still stuck somewhere.如果您仍然卡在某个地方,请告诉我。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM