我在Phaser 2上有游戏,我开始将其集成到Facebook中。 并且在允许用户与朋友共享的功能方面存在一些问题。
1)下面的代码示例:
window.onbeforeunload = function (e) {
e = e || window.event;
var y = e.pageY || e.clientY;
if (y < 0) {
console.log("Here you have to call logout.");
}
}
2)这是我的错误
let msg = 'Try this game'
FBInstant.shareAsync({
intent: "REQUEST",
image:user.playerPic,
text: "Hey I'm stuck on this target! Can you help me?",
data: {myReplayData:msg}
}).then(() => {
console.log("Success share");
this.resumeGame = true;
this.checkStatusContinue();
});
请提供帮助。谢谢。