How*_*oon 5 facebook typescript
对不起,我的英语不好,我做的事情(测试我的项目)就像在官方文档(https://developers.facebook.com)中一样。我用命令测试我的证书,没有错误。当我制作https服务器时,也没有错误。您可以在此处找到该项目:developers.facebook.com。
首先,我测试localhost:8080
,它显示我不安全并且 https 是红色的,当项目被嵌入时,是的,网址是https://www.facebook.com/embed/instantgames/YOUR_GAME_ID/player?game_url=https://localhost:8080
,此时网站似乎不起作用,它继续以 0% 加载。我不知道为什么。有人可以帮我吗?谢谢你的帮助!
您必须实际通知 API 您已完成加载。最小代码可以在此页面上找到,如下所示:
<script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
<script>
FBInstant.initializeAsync()
.then(function() {
});
// Once all assets are loaded, tells the SDK
// to end loading view and start the game
FBInstant.startGameAsync()
.then(function() {
// Retrieving context and player information can only be done
// once startGameAsync() resolves
var contextId = FBInstant.context.getID();
var contextType = FBInstant.context.getType();
var playerName = FBInstant.player.getName();
var playerPic = FBInstant.player.getPhoto();
var playerId = FBInstant.player.getID();
// Once startGameAsync() resolves it also means the loading view has
// been removed and the user can see the game viewport
game.start();
});
</script>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
632 次 |
最近记录: |